-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Odd behavior in StrictMode with array responses #53
Comments
Thanks for the repro. I'll be looking into this when I have time. We don't use the StrictMode tool so it may take me some time to investigate. If anyone else has thoughts on this feel free to chime in! |
Thanks @danReynolds. Initially when diving into this, I thought I was running into the same issue listed in #47 (comment). The bugged behavior seemed similar, but unsure if its related. Additionally, I did some investigation in the package looking for culprits in any of the dual executed strict mode methods: https://reactjs.org/docs/strict-mode.html#detecting-unexpected-side-effects . Nothing stood out to me immediately, but seems like it could be a likely culprit. |
Hi @danReynolds, just following up here to see if you've found anything. Of course I'm happy to dive in and help debug the root cause here, but could use a little guidance if you have any ideas where this is likely to occur. |
Hey @brandonwestcott yea I haven't had much time to explore this one yet. I should have some cycles upcoming in August, been on vacation through most of July. If anyone has any thoughts feel free to chime in in the meantime. It'll be my first time really using strict mode components so should be interesting |
Sounds great, thank you! Truly let me know if there is anything I can do to help. |
Thanks for this library, this truly solves a major gap in the apollo caching realm!
We've been using this pkg with apollo-cache-persist for a bit now, but only in a limited scope with a few types. Today I went to add invalidations to more types and ran into the following odd behavior:
When in development with
React.StrictMode
, queries that return arrays don't refetch upon invalidation.Code Sandbox:
https://codesandbox.io/s/apollo-cache-policies-strictmode-arrays-w97xhw
Reproduction:
Also note that if you click back 10s after the first load, but before the individual
query Mission
expires, you will see that Mission in the array because it's ttl got refreshed on on the show route.Reproduction:
Again, this only occurs in
React.StrictMode
--- removing that or building the app results in normal behavior.The text was updated successfully, but these errors were encountered: