-
Notifications
You must be signed in to change notification settings - Fork 942
firestore: minor refactor of listener registration of "versionchange" indexedb events #9087
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
base: main
Are you sure you want to change the base?
Conversation
…stener to be more abstract.
🦋 Changeset detectedLatest commit: 2ff82d8 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 |
Vertex AI Mock Responses Check
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
This PR modifies the
SimpleDb
class by deleting thesetVersionChangeListener()
method and replacing it with a newsetDatabaseDeletedListener()
method. The new method abstracts away the details of IndexedDb events and simply lets the caller get notified of the event in which it is interested, namely, impending or past deletion of the IndexedDb database.This PR is the first step in a multi-step chain of PRs that will unify the callback for "versionchange" events with
newVersion===null
and detection of "clear site data" button being pressed in web browsers. The latter logic was added in PR #8871 but was problematic in at least one case (issue #9056). The ultimate goal is to provide an experimental setting with which affected customers can opt out of the drastic response of the Firestore SDK to "close" events on the IndexedDb database when it appears that such an event is in response to the "clear site data" button being clicked, which can result in corruption of the IndexedDb database if ignored.