-
Notifications
You must be signed in to change notification settings - Fork 946
IndexedDB Recovery for Limbo documents #3039
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
Conversation
Binary Size ReportAffected SDKs
Test Logs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a note.
|
||
await this.applyRemoteEvent(event); | ||
|
||
// Since this query failed, we won't want to manually unlisten to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a moment to think I understand why this ordering is better. If I'm understanding correctly, the idea is to avoid removing the limbo target until we successfully apply the remote event because if we fail, we'll shut down the listen stream, and then when we resume we'll resend the limbo targets, right?
A comment to this effect could help future readers understand why the watch start/stop lifecycle makes this a reasonable choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If we can't update the cache, it is better for the documents to stay in limbo rather than go out of limbo temporarily. I modified the existing comment to say:
// Since this query failed, we won't want to manually unlisten to it.
// We only remove it from bookkeeping after we successfully applied the
// RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
// this query when the RemoteStore restarts the Watch stream, which should
// re-trigger the target failure.
Addresses #2755