urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.65k stars 454 forks source link

fix(core): Fix regression that broke cache-and-network #3174

Closed kitten closed 1 year ago

kitten commented 1 year ago

Resolves regression from #3157

Summary

This prevents us from blocking network-only operations which follow cache-and-network operations, if the latter has queued them up while the cached result comes in.

In other words, if result.stale is set, we still allow dispatched.delete to remove the key and unblock it if the current operations queue contains that operation. This basically is the equivalent of saying that we unblock operations, even if they're marked as stale if a new operation for them is already waiting to be sent.

Set of changes