I'm opening this question because in the transition from @urql/graphcache
version 4 to version 6 I noticed a breaking change which unfortunately is not fixable even using request-policy-exchange
(from the advice @kitten gave me).
Steps to reproduce (using request-policy-exchange
too)
Start the backend visiting: https://codesandbox.io/p/sandbox/h1pcl
Open the frontend reproduction: https://codesandbox.io/p/sandbox/n9zgfw
Go to the "Todos list" page and wait for todos list to be rendered
Now the cache is fullfilled with todos
Try to delete some todos, or click the button "Add more random todos"
Click on the "Reload" button
As you can see the (old) list is immediately loaded (from the cache) > a call is pending > but the
stale
flag is false and the data is not updated.
This is a big problem for our applications
Almost all of the clients of our customers are browsers on low hardware and with little RAM. Those browsers are closed by the operating system and are restarted when you return to use them. As you can imagine if the data is not reloaded when the page restarts it is a serious problem.
I also tried using shouldUpgrade, but the data doesn't get updated.