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

Gc timeout is not triggered in the context of a query declared with the defineQuery composable #32

Open
ElisePatrikainen opened this issue Apr 21, 2024 · 1 comment
Assignees
Labels
🐞 bug this isn't working as expected

Comments

@ElisePatrikainen
Copy link
Collaborator

It seems that the removeDep function is not called in the context of a query declared with the defineQuery composable. More precisely, the onScopeDispose hook seems not to be called.

Not sure if it is relevant, but I noticed that the scopes are not the same for a query declared with the useQuery composable and the defineQuery composable.

In the useQuery context:

Capture d’écran 2024-04-21 à 19 15 21

And in the defineQuery context:

Capture d’écran 2024-04-21 à 18 56 10

Note: I will provide later the demo of these two cases.

@posva posva added the 🐞 bug this isn't working as expected label Apr 22, 2024
@posva
Copy link
Owner

posva commented Apr 22, 2024

Nice catch. The funny part is that I wrote down this initially but forgot to implement it. There are cases where both, onUnmounted and onScopeDispose need to be used to work correctly. For globals like stores, the entry will never be gc collected until the key changes.

@ElisePatrikainen ElisePatrikainen self-assigned this May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug this isn't working as expected
Projects
Status: Todo
Development

No branches or pull requests

2 participants