-
Notifications
You must be signed in to change notification settings - Fork 893
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
Fix filtered get() cache #6497
Fix filtered get() cache #6497
Conversation
🦋 Changeset detectedLatest commit: b4c6eb6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This should also fix #6397 |
…ebase/firebase-js-sdk into mtewani/get-add-synctree-fix
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (234,696 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.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. Thanks!
@@ -324,7 +324,8 @@ export function syncTreeRemoveEventRegistration( | |||
syncTree: SyncTree, | |||
query: QueryContext, | |||
eventRegistration: EventRegistration | null, | |||
cancelError?: Error | |||
cancelError?: Error, | |||
skipListenerDedup = false |
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.
Can you explain what skipListenerDedup means in the function comments?
); | ||
} | ||
} else { | ||
// There's nothing below us, so nothing we need to start listening on |
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.
Is this an else block with no code in it? If so, why not delete it?
Fixed issue where get() would return incorrect results if you had a filtered
get()
and an event listeneronValue()
on the same path, and get() would override the data received by the push received byonValue()
yielding incorrect results.The fix below replicates the logic behind
onValue
onlyOnce
by adding the new event to the SyncTree with the new node, propagating events, and then removing the event from the tree.