Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query from useRefetchableFragment is not permanently retained within the component lifecycle #4729

Open
kyle-painter opened this issue Jul 1, 2024 · 1 comment

Comments

@kyle-painter
Copy link

When a refetch query is executed from useRefetchableFragment there is a temporaryRetain of the cache entry, however this is not paired with a corresponding permanentRetain during the components lifecycle.

This means after 5 minutes of idle time the cache entry is cleared, and upon the next render the entry will be read from the store and reinvoke the onComplete callback of any attached observable.

Here is an example reproducing the bug kyle-painter/relay-examples@09965ae. To reproduce:

  1. Press the 'Refetch' button and observe the onComplete alert dialog is shown.
    Kapture 2024-07-01 at 14 49 40

  2. Wait 5 minutes.

  3. Press the 'Rerender' button and observe the onComplete alert dialog is unexpectedly shown again.
    Kapture 2024-07-01 at 14 56 10

@janelawrence
Copy link

Can I take this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants