Skip to content

Remote config throws error in Firefox private browsing mode #2373

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
kenkus-futurice opened this issue Nov 20, 2019 · 7 comments · Fixed by #2381
Closed

Remote config throws error in Firefox private browsing mode #2373

kenkus-futurice opened this issue Nov 20, 2019 · 7 comments · Fixed by #2381

Comments

@kenkus-futurice
Copy link

Describe your environment

  • Operating System version: Windows 10
  • Browser version: Firefox 70.0.1 private mode
  • Firebase SDK version: 7.4.0
  • Firebase Product: remote config

Describe the problem

Remote config throws error in Firefox (possibly also related problem in IE 11 and Edge) private browsing mode.

Error: Remote Config: Error thrown when opening storage. Original error: A mutation operation was attempted on a database that did not allow mutations.. (remoteconfig/storage-open).

Steps to reproduce:

Load a web app that uses remote config in Firefox private browsing mode.

Relevant Code:

import * as firebase from 'firebase/app';
import 'firebase/remote-config';

const remoteConfig = firebase.remoteConfig();

remoteConfig.settings = {
  minimumFetchIntervalMillis: 3600000,
};

remoteConfig.fetchAndActivate()
  .then(() => {
    doSomething();
  })
  .catch((err) => {
    console.error(err);
  });
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@rommelpe
Copy link

Thanks for your report. I was able to replicate this. I'll confirm internally to see if this is an intended behavior or bug (b/144839642), and I'll let you know once I have an update.

@kenkus-futurice
Copy link
Author

I forgot to mention that it works fine in Chrome private mode.

@Feiyang1
Copy link
Member

Feiyang1 commented Nov 21, 2019

According to https://bugzilla.mozilla.org/show_bug.cgi?id=781982, indexeddb doesn't work in Firefox private mode and Remote config needs it to work.

The good news is that Firefox is working on enabling indexeddb in the private mode - https://bugzilla.mozilla.org/show_bug.cgi?id=1562669.

For now, if you have any way to detect the private mode, I'd suggest to do that and NOT initialize remote config if private mode is detected.

I will close the issue for now.

@kenkus-futurice
Copy link
Author

Alright, probably then similar reason with IE11/Edge private mode.

Another problem is that this promise doesn't return anything when the error occurs:

firebase.remoteConfig().fetchAndActivate()
    .then((res) => {
      // This is not printed
      console.log(res)
    })
    .catch((err) => {
      // This is not printed
      console.error(err)
    })
    .finally(() => {
      // This is not printed
      console.log('finally')
    })

Is there some other way of "handling" this error?

@Feiyang1
Copy link
Member

Feiyang1 commented Nov 26, 2019

Ah, good catch! Once #2381 is merged and released, you will be able to catch the error.

For now, are you able to detect the private mode and not initiate RC at all?

@kenkus-futurice
Copy link
Author

Thank you. Great news that you have already fixed this.
Probably I can do something (in IE11/Edge window.indexedDB seems to be null, in Firefox there are some hacks e.g. based on IndexedDB, but if I understood correctly the general direction is to make the browser APIs work also in private mode and make it harder to detect private mode in web apps) but perhaps I can wait until this fix is released.

@firebase firebase locked and limited conversation to collaborators Dec 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants