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

Filesystem corruption happening more often than we anticipated #450

Open
gideonthomas opened this issue Sep 1, 2015 · 6 comments
Open

Comments

@gideonthomas
Copy link

See https://news.ycombinator.com/item?id=10151485

@humphd
Copy link

humphd commented Sep 2, 2015

I think that's what this is: https://github.com/mozilla/thimble.webmaker.org/issues/1031

cc @modeswitch. We're seeing EFILESYSTEMERROR in Firefox in the wild. None of us can reproduce it. I wonder if it's older versions not letting them run the db across a third-party iframe?

@modeswitch
Copy link

From the other issue, it's almost certainly because he's in private browsing mode. Filer needs to be more polite when that happens, by providing a useful error message for the application to pass on to the user, and maybe even by providing a reasonable fallback if possible.

Users on older versions of Firefox will also have this problem, and I don't think there's an easy way of distinguishing between those and the private browsers.

@humphd
Copy link

humphd commented Sep 2, 2015

Firefox throws an InvalidStateError in Private Browsing mode. So we should probably wrap the call to IndexedDB open in a try...catch and send a better error up to Filer, ENOTPERMITTED or something that you can get in the app and provide UI.

See localForage/localForage#363 (comment)

@humphd
Copy link

humphd commented Sep 2, 2015

I spent a very frustraging afternoon trying to fix this in Filer, and I don't think it can be cleanly handled. Firefox throws when you try to indexeddb.open(), and won't allow you to catch the exception. It also means that your request.onerror handler never gets called. So you can't catch the error, and you can't get far enough for an error handler to fire. It's bonkers that they've chosen to do this.

I've asked for advice in https://bugzilla.mozilla.org/show_bug.cgi?id=781982#c27

@modeswitch
Copy link

Yeah, that seems broken. I caught myself up on the bug you linked. I'm not sure there's much we can do in Filer until the issue is addressed on the platform side.

@humphd
Copy link

humphd commented Sep 3, 2015

Josh suggests to put this in an iframe on startup:

var canUseIndexedDB = false;
function notifyParent() {
  window.parent.reportIndexedDBStatus(canUseIndexedDB);
}
setTimeout(notifyParent, 0);
window.indexedDB;
canUseIndexedDB = true;

@gideonthomas gideonthomas added the P3 label Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants