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

Web app crashed when opened in private tab #208

Closed
julianfoad opened this issue Apr 11, 2022 · 6 comments
Closed

Web app crashed when opened in private tab #208

julianfoad opened this issue Apr 11, 2022 · 6 comments
Labels
🪲 bug Something isn't working web-app Web app things

Comments

@julianfoad
Copy link

julianfoad commented Apr 11, 2022

  • I had the web-app of my self-hosted ntfy instance open in a normal Firefox tab. It was working fine, showing several subscriptions.
  • I opened a Firefox private browsing tab and opened the web-app of my self-hosted ntfy instance, https://ntfy.example.org.
  • The app opened up showing an error page instead of the expected content: "Oh no, ntfy crashed" with this stack trace:
DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.
 InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
  at undefined (DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.:undefined:undefined)
  at undefined ( InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.:undefined:undefined)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:16613:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:16801:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:15440:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:10172:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:10929:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:11290:1)

DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.
 InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
  at Ym@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:950278
  at Nf@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:883982
  at n@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:923169
  at P@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:355181
  at S@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:354906
  at C@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:355291
  at Ff@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:883242
  at im@https://ntfy.foad.me.uk/static/js/main.3e6ef68a.js:2:919841
  at Xm
  • I can reproduce it at the moment: any time I open it in a private-mode tab it does the same.
  • Version: as served by the Docker image id sha256:2fd60d0cd40195ca2d41e32131f79cdfabc6e3f766bf6acc4efcb5524771ce39.
  • Config: the only config option I set is --behind-proxy.
  • I am not waiting on a fix: I don't need this to work, I just stumbled across it.
@binwiederhier
Copy link
Owner

I am painfully aware of this. Apparently IndexedDB is not available in private browsing mode, which is what the web app uses to store its local state.

I am not aware of why the browsers chose to make IndexedDB unavailable, but from what I've read it's because of "privacy concerns". It's very ironic because ntfy is using IndexedDB so we don't have to store anything on the server, so this is a little puzzling to me.

There is no short workaround for this, because everything revolves around IndexedDB. Nothing can be stored without it, and Dexie.js (the lib I use) doesn't support any fallbacks.

It would be tremendeous effort to make it work, with very little benefit. Why would anyone use an app with local-only storage in private mode? The use cases are pretty much non-existant.

That said, I could make it crash nicer showing why/that it doesn't work and link to this issue.

Thank you for filing the ticket :-D

@binwiederhier binwiederhier added 🪲 bug Something isn't working web-app Web app things labels Apr 12, 2022
@binwiederhier
Copy link
Owner

I'm closing this as "won't fix" because as I said:

It would be tremendeous effort to make it work, with very little benefit. Why would anyone use an app with local-only storage in private mode? The use cases are pretty much non-existant.

Hope you understand.

@julianfoad
Copy link
Author

As I said originally, I have no need for the app to work in private browsing mode: I simply happened to be in that mode and it crashed. When it crashed there was no clue that this was the reason and a known limitation. Then (being the curious type) I investigated further.

This seems ideal:

I could make it crash nicer showing why/that it doesn't work...

But now that I myself know how to avoid the crash, it's nowhere on my priority wish list. I won't argue any further.

@binwiederhier binwiederhier reopened this Apr 28, 2022
@binwiederhier
Copy link
Owner

Re-opening as this just happened to another user. So I suppose I'll add a nicer error message :-D

@binwiederhier
Copy link
Owner

Did this. I hate it, but I also don't want to re-implement everything for a use case that doesn't exist.

220429 20-47-47 Selection 001

@julianfoad
Copy link
Author

Compared with a crash that's night-and-day better. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working web-app Web app things
Projects
None yet
Development

No branches or pull requests

2 participants