firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

Fix filtered get() cache

Open maneesht opened this issue 3 years ago • 4 comments

Fixed issue where get() would return incorrect results if you had a filtered get() and an event listener onValue() on the same path, and get() would override the data received by the push received by onValue() 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.

maneesht avatar Aug 02 '22 20:08 maneesht

🦋 Changeset detected

Latest commit: b4c6eb6bc21883ec475d0d4af3acd742df41e8e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/database Patch
@firebase/database-compat Patch
firebase Patch

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

changeset-bot[bot] avatar Aug 02 '22 20:08 changeset-bot[bot]

This should also fix #6397

maneesht avatar Aug 02 '22 20:08 maneesht

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (6a17eb6)Merge (c1df113)Diff
    browser13.9 kB14.1 kB+204 B (+1.5%)
    esm518.1 kB18.4 kB+246 B (+1.4%)
    main19.1 kB19.3 kB+242 B (+1.3%)
    module13.9 kB14.1 kB+204 B (+1.5%)
  • @firebase/database

    TypeBase (6a17eb6)Merge (c1df113)Diff
    browser248 kB248 kB-648 B (-0.3%)
    esm5276 kB276 kB-574 B (-0.2%)
    main282 kB281 kB-574 B (-0.2%)
    module248 kB248 kB-648 B (-0.3%)
  • @firebase/database-compat/standalone

    TypeBase (6a17eb6)Merge (c1df113)Diff
    main371 kB370 kB-574 B (-0.2%)
  • @firebase/firestore

    TypeBase (6a17eb6)Merge (c1df113)Diff
    browser264 kB264 kB+169 B (+0.1%)
    esm5327 kB327 kB+294 B (+0.1%)
    main525 kB525 kB+472 B (+0.1%)
    module264 kB264 kB+169 B (+0.1%)
    react-native264 kB264 kB+169 B (+0.1%)
  • @firebase/firestore-lite

    TypeBase (6a17eb6)Merge (c1df113)Diff
    browser80.5 kB80.7 kB+172 B (+0.2%)
    esm596.2 kB96.5 kB+297 B (+0.3%)
    main135 kB136 kB+446 B (+0.3%)
    module80.5 kB80.7 kB+172 B (+0.2%)
    react-native80.7 kB80.9 kB+172 B (+0.2%)
  • bundle

    43 size changes

    TypeBase (6a17eb6)Merge (c1df113)Diff
    analytics (logEvent)41.8 kB41.9 kB+110 B (+0.3%)
    app-check (CustomProvider)35.4 kB35.5 kB+110 B (+0.3%)
    app-check (ReCaptchaEnterpriseProvider)37.6 kB37.7 kB+110 B (+0.3%)
    app-check (ReCaptchaV3Provider)37.6 kB37.7 kB+110 B (+0.3%)
    auth (Anonymous)66.3 kB66.4 kB+110 B (+0.2%)
    auth (EmailAndPassword)70.4 kB70.5 kB+110 B (+0.2%)
    auth (GoogleFBTwitterGitHubPopup)90.3 kB90.4 kB+110 B (+0.1%)
    auth (GooglePopup)90.0 kB90.1 kB+110 B (+0.1%)
    auth (GoogleRedirect)90.2 kB90.3 kB+110 B (+0.1%)
    auth (Phone)76.5 kB76.6 kB+110 B (+0.1%)
    database (Append to a list of data)145 kB145 kB+110 B (+0.1%)
    database (Filtering data)144 kB144 kB+110 B (+0.1%)
    database (Listen for child events)160 kB160 kB-120 B (-0.1%)
    database (Listen for value events + Detach listeners)160 kB160 kB-120 B (-0.1%)
    database (Listen for value events)160 kB160 kB-120 B (-0.1%)
    database (Read data once)156 kB159 kB+2.77 kB (+1.8%)
    database (Save data as transactions)162 kB162 kB-120 B (-0.1%)
    database (Sort data)145 kB145 kB+110 B (+0.1%)
    database (Write data)144 kB144 kB+110 B (+0.1%)
    firestore (Persistence)274 kB274 kB+280 B (+0.1%)
    firestore (Query Cursors)211 kB211 kB+273 B (+0.1%)
    firestore (Query)212 kB212 kB+273 B (+0.1%)
    firestore (Read data once)200 kB200 kB+273 B (+0.1%)
    firestore (Realtime updates)202 kB203 kB+273 B (+0.1%)
    firestore (Transaction)184 kB184 kB+273 B (+0.1%)
    firestore (Write data)184 kB184 kB+273 B (+0.1%)
    firestore-lite (Query Cursors)67.9 kB68.2 kB+282 B (+0.4%)
    firestore-lite (Query)71.1 kB71.4 kB+282 B (+0.4%)
    firestore-lite (Read data once)55.5 kB55.8 kB+279 B (+0.5%)
    firestore-lite (Transaction)80.1 kB80.3 kB+282 B (+0.4%)
    firestore-lite (Write data)65.3 kB65.5 kB+282 B (+0.4%)
    functions (call)29.2 kB29.3 kB+110 B (+0.4%)
    messaging (send + receive)45.1 kB45.3 kB+110 B (+0.2%)
    performance (trace)49.6 kB49.7 kB+110 B (+0.2%)
    remote-config (getAndFetch)44.2 kB44.3 kB+110 B (+0.2%)
    storage (getBytes)37.5 kB37.6 kB+110 B (+0.3%)
    storage (getDownloadURL)39.6 kB39.7 kB+110 B (+0.3%)
    storage (getMetadata)39.0 kB39.1 kB+110 B (+0.3%)
    storage (list + listAll)38.4 kB38.6 kB+110 B (+0.3%)
    storage (updateMetadata)39.3 kB39.4 kB+110 B (+0.3%)
    storage (uploadBytes)43.8 kB43.9 kB+110 B (+0.3%)
    storage (uploadBytesResumable)53.3 kB53.4 kB+110 B (+0.2%)
    storage (uploadString)44.0 kB44.2 kB+110 B (+0.2%)
  • firebase

    TypeBase (6a17eb6)Merge (c1df113)Diff
    firebase-app-compat.js27.7 kB27.8 kB+90 B (+0.3%)
    firebase-app.js87.4 kB87.7 kB+334 B (+0.4%)
    firebase-compat.js794 kB794 kB-147 B (-0.0%)
    firebase-database-compat.js166 kB166 kB-413 B (-0.2%)
    firebase-database.js606 kB606 kB-397 B (-0.1%)
    firebase-firestore-compat.js314 kB314 kB+170 B (+0.1%)
    firebase-firestore-lite.js267 kB267 kB+399 B (+0.1%)
    firebase-firestore.js851 kB852 kB+396 B (+0.0%)
    firebase-performance-standalone-compat.es2017.js87.5 kB87.6 kB+104 B (+0.1%)
    firebase-performance-standalone-compat.js65.3 kB65.4 kB+104 B (+0.2%)

Test Logs

google-oss-bot avatar Aug 02 '22 21:08 google-oss-bot

Size Analysis Report 1

This 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

google-oss-bot avatar Aug 02 '22 21:08 google-oss-bot