Closed godismyjudge95 closed 2 months ago
This issue was probably caused by changes in #9408, where it manually pushes to the history stack.
Our site also experiences this, and it only seems to be the users table for us, not any collection or user groups from what I can see. Before upgrading it worked. So I think Duncan is right about the cause. I will try to downgrade to 4.54 tomorrow and see if it was 4.55 that introduced the bug.
This is definitely happening since https://github.com/statamic/cms/pull/9408, you can test by setting pushQuery: false
in resources/js/components/users/Listing.vue
. But it's suuuuuper weird.
Looking at the response when you hit back Chrome is loading the XHR response from it's cache, rather than the HTML page you'd expect:
Unlike the other listing tables, the user listing page shares the same URL as the JSON endpoint we use to actually get the user info:
https://github.com/statamic/cms/blob/4.x/src/Http/Controllers/CP/Users/UsersController.php#L35-L37
I have a feeling the browser is caching the JSON response since it comes after the initial page so that's what you end up looking at when you click "Back".
Ah yeah, that makes sense.
Still, I don't think the XHR response should be cached as a page right? That feels like a Chrome(ium) bug. Unless anyone's seeing the same behaviour in other browsers?
Ok, looks like it might be a chrome specific issue, but... the fix (untested atm) looks pretty simple: https://www.jonathancreamer.com/chrome-back-button-in-express-caching-issue-solved/
Obligatory SO post: https://stackoverflow.com/questions/9956255/chrome-displays-ajax-response-when-pressing-back-button
Bug description
Ran into this issue while creating a custom filter view for users. If you filter the users table using any method of filtering, then click on any user, and then click the browser back button you get the JSON response (that I imagine feeds the Vue table) instead of the actual page.
How to reproduce
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
I believe this may be due to how history is being manually pushed onto the history stack. I might look into it if I have time.