-
Notifications
You must be signed in to change notification settings - Fork 884
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
Re-open IndexedDB if closed #3535
Conversation
🦋 Changeset is good to goLatest commit: 5596625 We got this. This PR includes changesets to release 10 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 |
Binary Size ReportAffected SDKs
Test Logs
|
2fec973
to
fa7a185
Compare
fa7a185
to
e8c09bb
Compare
ddd57b2
to
9a03405
Compare
|
||
request.onblocked = () => { | ||
reject( | ||
new IndexedDbTransactionError( |
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 mostly a copy of the code above, but this line changed from FirestoreError to IndexedDbTransactionError.
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
db.close(); | ||
await db.runTransaction('readwrite', V1_STORES, () => | ||
PersistencePromise.resolve() | ||
); |
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 test doesn't make an assertion, which is usually a sign that something's missing. If this would implicitly fail somehow it's worth adding a comment about that or perhaps adding a does not throw expectation.
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.
I am not sure how expect().doesNotThrow()
interacts with Promises, so I added a comment instead.
This PR addresses an IndexedDb error that may occur when a transaction is first opened. The error
The database connection is closing
can be reproduced locally by invoking SimpleDb.close() and then callingdb.transaction
and this PR fixes at least this case by extending the IndexedDB retry code to include the code arounddb.transaction
and by closing and re-opening the IndexedDB instance.Fixes #3495