quadratic
quadratic copied to clipboard
Hitting the back button after creating a file causes infinite loading indication on the dashboard
Steps to reproduce:
- From the dashboard, create a new individual file
- After the file loads, hit the browser's back button
- Dashboard is in loading mode. No console or network errors.
This is a tricky one. I can't reproduce on localhost
but I can with the preview branch.
I'm assuming this has something to do with how we changed from using a manual redirect to using reloadDocument
from the react-router package. Both have their drawbacks.
Today in production, if you do this, you'll go back to where you were and the browser uses it's own cache to do this, so when you go back to "my files" the file you just created won't be there (because you went back in time to the page you were looking at, not back to the same URL but with updated data).
This seems to be working the same way, where hitting "back" takes you back to the page you were just at in its most recent state, which is a loading state (when you clicked "create", the dashboard part of the app went in to a loading state while it made a request to create a new page from the server, so that's really what you're navigating back to).
I'm not sure how to get around this, as it's a browser-level issue with how the back button works. Probably need to spend more time reading this article on the bfcache and then figuring out the right fix
Can't repro in prod - plz reopen if someone experiences this