Open chriserickson opened 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
any news on this? I've bumped into the same kind of error, I wanted to use @required(action: THROW)
as a way to detect if a user was logged in, catch when it's not the case in an error boundary to show a login page and refetch the data once the user has logged in. The whole thing was really elegant, but unfortunately, even though the right data is fetched, the UI still reflects the old data before login, so the user has to manually refresh the page, it destroys the whole benefit.
Context: Given a query that is returning a partial response that, due to a bug in some view code, throws to an error boundary.
We'd like to generically be able to retry all queries (from the error boundary) to see if the backend has recovered.
Currently, the try-again code does the following: 1) calls commitLocalUpdate and calls invalidateStore() on the store. 2) Increments the query keys for EVERY query in the app. 3) Remounts the children
Here is what we are seeing: 1) The component DOES suspend, as expected. I believe this is a result of invalidating the store (otherwise it doesn't suspend, even when incrementing the fetchKey due to store-or-network being the default policy). 2) A new request IS made, as expected. 3) When suspense resolves, the OLD data is returned (with the null values still). <--- THIS IS UNEXPECTED
See reproduction case