urql: (vue) - Promisified useQuery deadlocks or fails to update fetching

(I will try to put together a repro maybe tomorrow)

  • @urql/core@2.0.0
  • @urql/vue@0.3.0
  • exchanges: dedupExchange, cacheExchange, ssrExchange, fetchExchange
  • requestPolicy: tried both default and “cache-and-network”

Steps to reproduce

  • pass initialState to ssrExchange
  • await useQuery in async setup

Expected behavior

Expect useQuery to resolve immediately (and then depending on requestPolicy, maybe refreshing)

Actual behavior

await useQuery(...) hangs forever, async setup never resolves, and the component never hydrates.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

It’s currently extremely hard to pinpoint this issue as I haven’t been able to reproduce it in an artifical unit test of ours, here. I tried to remove the delay but that didn’t really help and I still don’t quite have a minimal reproduction in unit tests.

In the meantime I’ve started a simplified useQuery implementation but I’ll have to test this: https://github.com/FormidableLabs/urql/tree/fix/vue-suspense-deadlock

@tjk: I’ll follow up on what this does in your repro at https://github.com/tjk/urql-vue-ssr-issue and will report back on that. Haven’t really gotten to the testing phase just yet. I do see that you reproduced this with the latest @urql/core version which is actually excellent. Mostly this means that we just need to figure out the best implementation for useQuery. However, this has gotten much easier in @urql/core@2.1.0 as we there don’t need to worry about the potentially duplicate subscription. Either way, the current implementation on main is a little too convoluted.

Edit: @tjk, the good news is, this isn’t reproducible with the repo above and the new branch. The bad news is, I also can’t reproduce the issue as is with your repo 😕

@tjk No worries, we’re aiming to have more examples ready soon to make sure that we can properly provide resources to reproduce issues across all bindings

Not sure I can repro at the moment so just closing. If I notice this again will re-open and add more info. Sorry.