-
Notifications
You must be signed in to change notification settings - Fork 944
Don't persist documents that we already have #2099
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
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.
Exactly the same comments as the Android port plus one question.
@@ -580,22 +558,21 @@ export class LocalStore { | |||
// can synthesize remote events when we get permission denied errors while | |||
// trying to resolve the state of a locally cached document that is in | |||
// limbo. | |||
const remoteVersion = remoteEvent.snapshotVersion; | |||
if (!remoteVersion.isEqual(SnapshotVersion.MIN)) { | |||
if (!snapshotVersion.isEqual(SnapshotVersion.MIN)) { |
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.
Question: why doesn't this change apply to the Android port?
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.
This is just a rename to which allows me to use an object shorthand notation (instead of {snapshotVersion:remoteVersion} I can now use {snapshotVersion}.
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.
Addressed your feedback (ported the changes for Android).
Since I was mucking around in the same codepath I also pulled in firebase/firebase-android-sdk#721
@@ -580,22 +558,21 @@ export class LocalStore { | |||
// can synthesize remote events when we get permission denied errors while | |||
// trying to resolve the state of a locally cached document that is in | |||
// limbo. | |||
const remoteVersion = remoteEvent.snapshotVersion; | |||
if (!remoteVersion.isEqual(SnapshotVersion.MIN)) { | |||
if (!snapshotVersion.isEqual(SnapshotVersion.MIN)) { |
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.
This is just a rename to which allows me to use an object shorthand notation (instead of {snapshotVersion:remoteVersion} I can now use {snapshotVersion}.
This PR changes the handling of remote documents to skip any document updates for document versions that we already have cached. To keep the code readable, I removed the concept of
authoritativeUpdates
(as discussed in the API discussion phase of Sprint planning).