-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Products_v3: URL state management broken #11640
Comments
I had to troubleshoot this on au-staging. I don't think
I tried changing the action_cable config to use + config.action_cable.url = "#{ENV['SITE_URL']}/cable"
+ config.action_cable.allowed_request_origins = [/http:\/\/#{ENV['SITE_URL']}\/*/, /https:\/\/#{ENV['SITE_URL']}\/*/] Looks promising:
But this resulted in something like:
I tried commenting out the
So there's something not configured right still... |
This was hard to debug on dev. I tried to boot up rails in staging mode, and got stuck here:
Loading a page generates internal_server_error but I can't see what the error was. |
The problem remains: when you choose a pagination option (and presumably a filter), the page is submitted with a GET request with params, but the params seem to get lost on the second submit. The most notable problem is that it is not possible to get past page 1, when you have chosen a different page size (see video and description here: https://openfoodnetwork.slack.com/archives/C01CXQNJ1J6/p1720786387419379) |
The search/filter/pagination logic is shared with the orders screen, see: |
Yes, I also noticed that. Let me check this and get back to you, my hunch is that turbo might be doing something here |
The PR is ready for review. Thanks. |
Description
Expected Behavior
When you apply a search term, producer filter, category filter, or pagination, the page state changes (different products are shown).
To reflect this, the URL in the addressbar should be updated. Also there should be a new item added in browser history, allowing you to go back/forward.
Items such as this should appear on the end of the URL: _page&_per_page , _search_term, _producer_id, _category_id.
Actual Behaviour
But the feature only seems to work in dev mode. On staging and prod, the following error appears:
Steps to Reproduce
Workaround
Make sure you remember what filters/pages you used. Don't click Back.
Severity
Your Environment
Possible Fix
https://openfoodnetwork.slack.com/archives/C01CXQNJ1J6/p1695915680526909?thread_ts=1695879707.687969&cid=C01CXQNJ1J6
The text was updated successfully, but these errors were encountered: