You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With how the provider is currently constructed, a parent re-render will orphan an apollo client instance and create a new one. I believe this causes a memory leak and cache orphaning. I discovered it because of client pollution visible when using Apollo Client's dev tools.
This is due to the lack of memoization where the client is instantiated here.
How do we reproduce the bug?
Force a re-render of a parent of the RedwoodApolloProvider, for example App. Using the Apollo Client devtools, observe a new client instantiation each render.
What's your environment? (If it applies)
No response
Are you interested in working on this?
I'm interested in working on this
The text was updated successfully, but these errors were encountered:
Thanks for the really clearly documented issue! I see you are interested in helping out with it, awesome! Are you hoping to create a PR with a fix? If so I'd be happy to help out in any way you might need.
@callingmedic911 Just seeing this now, I hadn't considered using WeakRef. I submitted a PR #11699 if you'd like to take a look. I'm jus using a local variable to keep track of the current instance.
What's not working?
With how the provider is currently constructed, a parent re-render will orphan an apollo client instance and create a new one. I believe this causes a memory leak and cache orphaning. I discovered it because of client pollution visible when using Apollo Client's dev tools.
This is due to the lack of memoization where the client is instantiated here.
How do we reproduce the bug?
Force a re-render of a parent of the
RedwoodApolloProvider
, for exampleApp
. Using the Apollo Client devtools, observe a new client instantiation each render.What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: