-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Queries or mutations hang when using 'cache-first' or 'cache-only' request policies #1633
Comments
we encountered this in eas-cli as well, except in our case rather than hanging the node process would exit immediately with status code 0. we didn't tease out a minimal reproducible example from this unfortunately, but i'm happy to walk a maintainer through reproducible it within our repository if needed. we are locking our urql version to 2.0.0 for now to avoid this issue. |
@tmaxmax @brentvatne Let's try to narrow this down first ✌️ We suspect this is only happening in Edit: actually, it may look like we have some kind of weird condition in which |
i wasn't super familiar with this code before i started to investigate this issue, so i'm not sure if this is the right thing - what i did was add some logging with
i was also rather confused by this |
I'm still very confused myself, but I'm hitting myself for not finding a nicer implementation for our new replay/single-source behaviour in |
@tmaxmax @brentvatne This should be fixed in |
After a while of using this client, queries and mutations started to hang indefinitely if using request policies that try retrieving from the cache first. What is surprising is that this didn't happen since the beginning and it happens when deployed and on local m Linux machine, but not on my other Windows computer. As a temporary solution, I am using
cache-and-network
for queries andnetwork-only
for mutations, at the expense of longer loading times and wasteful requests.urql version & exchanges:
Steps to reproduce
It's not clear to me how I could reproduce this. I'm having this problem in a Svelte + Hasura application, which in development is ran using a devcontainer configured with docker-compose (link, if useful), and is deployed to Vercel in production. I've noticed that it doesn't happen when running the development environment on Windows.
I am also using rxjs in my codebase, so I have some helpers that wrap urql's queries and mutations' promises into observables: (code here). I stepped through my code with both Chrome's and Firefox's debuggers and it didn't result that my helpers were a problem, but knowing this implementation detail maybe could help.
As a sidenote, this doesn't seem to happen when using the Svelte-specific helpers (
query
,mutation
,operationStore
). You can find here the queries used in my project - maybe there's something about them that breaks the client's caching system.Finally, if you have any idea on how I could isolate this problem I will certainly use it to improve this issue.
Expected behavior
Fetch the response successfully, according to the given policy.
Actual behavior
Hangs indefinetly after calling either the
query
ormutation
methods (subscriptions work).I hope it's the right place to ask this, as I believe there's a chance this isn't related to the urql client, and I definitely could use some help with it - I'm at a complete loss and without any idea on how to fix this. Thanks for your help and attention, and for the extensive effort that went into creating this library!
The text was updated successfully, but these errors were encountered: