-
-
Notifications
You must be signed in to change notification settings - Fork 725
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
Fix NoMethodError in order cycles index #2383
Fix NoMethodError in order cycles index #2383
Conversation
When a user's session has timed out and they try to load new data on the order cycles page by changing filters, the application throws a `NoMethodError` because we are prepending the load data method before checking the user's session. We can fix this by removing the prepend on this action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I can't remember exactly, and the specs are not that helpful, but I suspect it was something to do with altering the ransack query params in the It looks like 2a5f598 rewrote most of this stuff anyway, and if the current version of the controller specs aren't broken by this change, then I think we just have to trust that everything is ok. We should still do rigorous testing around loading more order cycles using the button on the index though. |
Thank you for the explanation @oeoeaio. |
Fingers crossed... |
Staged on https://staging1.openfood.com.au/. |
@mkllnk I've tried to login as spree@example on staging but it's not working. What kind of other admin account can I use to test this ? Thanks :) |
@RachL we use another user to test on Aus staging I got the credential I give them to you... I know it's still super messy we really need to have those common seeds data implemented please!!! |
Thanks for the login info @myriamboure ! This is ready to go. However is there already somewhere an issue open in order to display a message in that case? |
I just tested this myself, because the infinite spinner doesn't tell if the server encountered an error or not. Previously, when you logged out in another window and then tried to load more order cycles, the server would throw an error. Now it recognises correctly, that the user is not logged in and redirects to the login. Since this happens in a JSON request, the Javascript doesn't know what to do with the result and just shows that infinite spinner. A user is most likely to refresh the page which will then prompt for login. Pass. This is much better then before. As Rachel said, we need a new issue for the infinite spinner though. In JSON requests, the redirect should be handled differently. It should be a valid JSON reply telling the browser to show the login modal (or redirect there). |
What? Why?
Closes #2271
When a user's session has timed out and they try to load new data on the
order cycles page by changing filters, the application throws a
NoMethodError
because we are prepending the load data method beforechecking the user's session.
We can fix this by removing the prepend on this action.
What should we test?
Loading and filtering the order cycles page. (Show 30 more days or Show 90 more days)