Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert user when error requesting a report #12867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dacook
Copy link
Member

@dacook dacook commented Sep 17, 2024

I'm not sure why, but Turbo was swallowing the unauthorized error, so I thought we should alert the user to help with debugging. Same with network error, it gave no feedback before.

I think this can be tested with Capybara in theory, but I haven't invested the time on it.

What should we test?

This occurs whenever submitting a form with Turbo. The best example is running any report.

There are three types of errors, I can think of a way to test two of them:

  1. Network error: turn off wifi/disable network
  2. Authorisation error: This can be tested with bug Asking a report has no result when the producer is set as profile only (doesn't sell products) #12835. Otherwise I think you could test this by log out in another tab then log in as a shopper
  3. Other errors (eg 500)

I'm not sure why, but Turbo was swallowing the unauthorized error, so I thought we should alert the user to help with debugging.
Same with network error, it gave no feedback before.

I think this is testable in theory, but I haven't invested the time on it.
@dacook dacook added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Sep 17, 2024
@dacook dacook self-assigned this Sep 17, 2024
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one ! we could probably do something a bit nicer than using an alert but that's better than nothing. I hate it when error get swallowed.

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's causing issue on the bulk product page, if you try to update a product that will fails we get a 422 that we handle nicely on the UI. But with this change we now get an alert !

@dacook
Copy link
Member Author

dacook commented Sep 18, 2024

Oh, that makes sense, thanks for checking that out. It's worrying that the specs didn't pick that up!

@rioug
Copy link
Collaborator

rioug commented Sep 18, 2024

Oh, that makes sense, thanks for checking that out. It's worrying that the specs didn't pick that up!

I think the system specs accept alert by default if no behaviour specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Status: In Progress ⚙
Development

Successfully merging this pull request may close these issues.

2 participants