Skip to content

firestore: null out IndexedDB connection when it is unexpectedly closed #8870

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
wants to merge 2 commits into from

Conversation

dconeybe
Copy link
Contributor

This change simply avoids using a known-closed IndexedDB connection, which would be guaranteed to fail.

…o that it does not get used after being closed, which is guaranteed to fail and can cause issues.
@dconeybe dconeybe self-assigned this Mar 26, 2025
@dconeybe dconeybe requested review from a team as code owners March 26, 2025 19:26
Copy link

changeset-bot bot commented Mar 26, 2025

🦋 Changeset detected

Latest commit: b97925b

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

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat 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

@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (dcc62c0)Merge (ae8fe28)Diff
    browser381 kB381 kB+205 B (+0.1%)
    main590 kB591 kB+233 B (+0.0%)
    module381 kB381 kB+205 B (+0.1%)
    react-native381 kB382 kB+205 B (+0.1%)
  • bundle

    TypeBase (dcc62c0)Merge (ae8fe28)Diff
    firestore (CSI Auto Indexing Disable and Delete)272 kB272 kB+191 B (+0.1%)
    firestore (CSI Auto Indexing Enable)272 kB272 kB+191 B (+0.1%)
    firestore (Persistence)303 kB303 kB+191 B (+0.1%)
    firestore (Read Write w Persistence)328 kB328 kB+191 B (+0.1%)
  • firebase

    TypeBase (dcc62c0)Merge (ae8fe28)Diff
    firebase-compat.js793 kB793 kB+187 B (+0.0%)
    firebase-firestore-compat.js339 kB339 kB+187 B (+0.1%)
    firebase-firestore.js440 kB440 kB+206 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/n0KUUf5MSr.html

@google-oss-bot
Copy link
Contributor

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • clearIndexedDbPersistence

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size24.2 kB24.5 kB+290 B (+1.2%)
      size-with-ext-deps94.4 kB94.7 kB+294 B (+0.3%)

      Dependency

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      functions

      14 dependencies

      __PRIVATE_argToString
      __PRIVATE_checkForAndReportiOSError
      __PRIVATE_cloneLongPollingOptions
      __PRIVATE_getAndroidVersion
      __PRIVATE_hardAssert
      __PRIVATE_indexedDbStoragePrefix
      __PRIVATE_isIndexedDbTransactionError
      __PRIVATE_logDebug
      __PRIVATE_logError
      __PRIVATE_validateIsNotUsedTogether
      __PRIVATE_wrapRequest
      clearIndexedDbPersistence
      fail
      getDocument

      15 dependencies

      __PRIVATE_argToString
      __PRIVATE_checkForAndReportiOSError
      __PRIVATE_cloneLongPollingOptions
      __PRIVATE_getAndroidVersion
      __PRIVATE_hardAssert
      __PRIVATE_indexedDbStoragePrefix
      __PRIVATE_isIndexedDbTransactionError
      __PRIVATE_logDebug
      __PRIVATE_logError
      __PRIVATE_logWarn
      __PRIVATE_validateIsNotUsedTogether
      __PRIVATE_wrapRequest
      clearIndexedDbPersistence
      fail
      getDocument

      + __PRIVATE_logWarn

    • enableIndexedDbPersistence

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size186 kB187 kB+190 B (+0.1%)
      size-with-ext-deps258 kB259 kB+191 B (+0.1%)
    • enableMultiTabIndexedDbPersistence

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size222 kB222 kB+190 B (+0.1%)
      size-with-ext-deps294 kB295 kB+191 B (+0.1%)
    • persistentLocalCache

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size182 kB183 kB+190 B (+0.1%)
      size-with-ext-deps254 kB255 kB+191 B (+0.1%)
    • persistentMultipleTabManager

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size218 kB218 kB+190 B (+0.1%)
      size-with-ext-deps290 kB290 kB+191 B (+0.1%)
    • persistentSingleTabManager

      Size

      TypeBase (dcc62c0)Merge (ae8fe28)Diff
      size182 kB182 kB+190 B (+0.1%)
      size-with-ext-deps254 kB254 kB+191 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/no3GRmnheX.html

@dconeybe
Copy link
Contributor Author

Closed in favor of #8871

@dconeybe dconeybe closed this Mar 27, 2025
@dconeybe dconeybe deleted the dconeybe/SimpleDbCloseOnBrowserStorageClear branch March 27, 2025 03:11
@firebase firebase locked and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants