Skip to content

unbreak LiveState unsub when references.size === 0 #4832

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

Closed
Prev Previous commit
Merge branch 'main' into unbreak-livestate-unsub
  • Loading branch information
subtleGradient authored Dec 13, 2024
commit 81ea3320fa6196023b3ead611a15b3cf387ac26b
6 changes: 6 additions & 0 deletions packages/relay-runtime/store/RelayModernStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,12 @@ class RelayModernStore implements Store {
// $FlowFixMe - this value if it is not null, it is a function
maybeResolverSubscription();
}
this._recordSource.remove(dataID);
if (this._shouldRetainWithinTTL_EXPERIMENTAL) {
// Note: A record that was never retained will not be in the roots map
// but the following line should not throw
this._roots.delete(dataID);
}
}
this._recordSource.remove(dataID);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.