Fix edge case issue around unsubscribing live queries
This only happens when...
- A live query is passed to
useLazyLoadQueryNode() - The initial fetch doesn't suspend
- Two components subscribe to the same query with the same operation descriptor
- The first subscribed component gets unmounted first
The fix is pretty simple though 😋
@XiNiHa I think I've been hesitant to merge this for fear that there are some edge cases I'm not aware of here and that it could break things when I roll it out. Would you be willing to add this change (fix) behind a feature flag?
https://github.com/facebook/relay/blob/4130d410ae1481b99ece8798d85d79e70557332e/packages/relay-runtime/util/RelayFeatureFlags.js#L16
@XiNiHa Curious if you'll be able to add a flag here.
Oops, missed the notification 😅 Will make it done today
The test started to pass even without the fix 🤔 let me figure out what's happening...
@XiNiHa Any progress here?
I haven't looked into this for a while. Maybe we could just close the PR since it wasn't possible to reproduce the issue after rebasing....