Skip to content
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

Firefox Private Browsing: A mutation operation was attempted on a database that did not allow mutations #4069

Closed
boldtrn opened this issue Nov 13, 2020 · 9 comments

Comments

@boldtrn
Copy link

boldtrn commented Nov 13, 2020

  • Operating System version: Ubuntu
  • Browser version: Firefox 82.0.3 (Private Browsing)
  • Firebase SDK version: 8.0.2
  • Firebase Product: auth, firestore (auth, database, storage, etc)

Steps to reproduce:

When opening the website with Firefox private browsing the following error is thrown:

Uncaught Error: InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.

This is thrown here:

function uk(a) {
    return new D(function (b, c) {
      var d = a.v.open("firebaseLocalStorageDb", 1);

      d.onerror = function (e) {
        try {
          e.preventDefault();
        } catch (f) {}

        c(Error(e.target.error));
      };
@hsubox76
Copy link
Contributor

hsubox76 commented Nov 13, 2020

Triage note: This seems to be in auth code accessing indexedDB.

@jdpt0
Copy link

jdpt0 commented Nov 14, 2020

I'm getting the same issue in Firebox 82.0.3 Private Browsing with Firebase SDK version 8.0.2 on Windows 10.

@ckybonist
Copy link

ckybonist commented Nov 16, 2020

Triage note: This seems to be in auth code accessing indexedDB.

Is the error raised from here? @hsubox76
https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/storage/indexeddb.js#L298

@jahed
Copy link

jahed commented Nov 18, 2020

Worth mentioning that this seems to be a fatal error. There doesn't seem to be a way to catch errors when calling firebase.auth() to fail authentication. Auth doesn't have any error hooks so anything waiting on it will hang indefinitely.

I guess the only workaround is to wrap any firebase.auth calls in a timeout since there's a chance it'll hit a silent dead end.

@aliokan
Copy link

aliokan commented Nov 27, 2020

Is someone find a solution to firebase.getAuth() signIn on Firefox Private window?

@kechpaja
Copy link

kechpaja commented Dec 1, 2020

@aliokan in my own project at least, this bug only appears in very recent versions. If you step back through the availalbe versions until the bug goes away, you should be able to mitigate it for the the time being.

@harshit-j
Copy link

harshit-j commented Dec 1, 2020

This bug appeared in 8.0.2 release https://firebase.google.com/support/release-notes/js#version_802_-_november_12_2020
Probably because of this fix: #1926

@hsubox76
Copy link
Contributor

hsubox76 commented Dec 1, 2020

I think this may be the same bug as #4113. I believe Firefox's message for that same error ("IDBFactory.open() called in an invalid security context") is the text reported in this issue ("A mutation operation was attempted on a database that did not allow mutations.")

@sam-gc
Copy link
Contributor

sam-gc commented Dec 8, 2020

Hi everyone, thanks for your patience. This should be fixed by #4146, which is included in 8.1.2. Please upgrade to 8.1.2 for the fix. Thanks!

@sam-gc sam-gc closed this as completed Dec 8, 2020
@firebase firebase locked and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests