Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Allow IndexedDB cleanup operations to fail #9903

Closed
wants to merge 1 commit into from

Conversation

clarkf
Copy link
Contributor

@clarkf clarkf commented Jan 12, 2023

Firefox ships with a preference (dom.indexedDB.privateBrowsing.enabled, defaults to false) which causes window.indexedDB to fail on all requests, including deleteDatabase. Because of that, recent builds fail to load entirely in private browsing windows. This can be verified by opening develop.element.io (or any build after matrix-org/matrix-js-sdk@15ef8fa) in a Firefox private browsing window.

MatrixClient#clearStores will resolve to a rejected promise if any of its operations fails, which seems correct – it's unable to complete its tasks. So, to keep from erroring out during initialization, the errors have to be discarded during the lifecycle operations.

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This PR currently has none of the required changelog labels.

A reviewer can add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is, or add Type: [enhancement/defect/task] to the description and I'll add them for you.

Firefox ships with a preference (`dom.indexedDB.privateBrowsing.enabled`) which
causes `window.indexedDB` to fail on all requests including `deleteDatabase`.
Because of that, Firefox Private Browsing users are left with an infinite
loading spinner.

`MatrixClient#clearStores` will resolve to a rejected promise if any of its
operations fails, which seems correct -- it's unable to complete its tasks.
So, to keep from erroring out during initialization, the errors have to be
discarded during the lifecycle operations.

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
@clarkf clarkf requested a review from a team as a code owner January 12, 2023 17:10
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Jan 12, 2023
@t3chguy
Copy link
Member

t3chguy commented Jan 12, 2023

This was just fixed in the js-sdk - matrix-org/matrix-js-sdk#3058

@clarkf
Copy link
Contributor Author

clarkf commented Jan 12, 2023

Ah, great, thanks! Guess I was slow to the punch, I checked for issues, but it must've been before everything cropped up.

@clarkf clarkf closed this Jan 12, 2023
@clarkf clarkf deleted the ff-indexeddb-error branch January 12, 2023 17:21
@richvdh
Copy link
Member

richvdh commented Jan 12, 2023

@clarkf thanks for this! I do want to add some tests to make sure this doesn't regress; if it's ok with you I'll use your new test as a basis.

@clarkf clarkf restored the ff-indexeddb-error branch January 12, 2023 18:37
@clarkf
Copy link
Contributor Author

clarkf commented Jan 12, 2023

@richvdh sure thing, however I can help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants