[GH-ISSUE #208] Web app crashed when opened in private tab #165

Closed
opened 2026-05-07 00:20:51 +02:00 by BreizhHardware · 6 comments

Originally created by @julianfoad on GitHub (Apr 11, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/208

  • 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.
Originally created by @julianfoad on GitHub (Apr 11, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/208 * 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.
BreizhHardware 2026-05-07 00:20:51 +02:00
Author
Owner

@binwiederhier commented on GitHub (Apr 11, 2022):

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

<!-- gh-comment-id:1095063307 --> @binwiederhier commented on GitHub (Apr 11, 2022): 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
Author
Owner

@binwiederhier commented on GitHub (Apr 28, 2022):

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.

<!-- gh-comment-id:1111613750 --> @binwiederhier commented on GitHub (Apr 28, 2022): 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.
Author
Owner

@julianfoad commented on GitHub (Apr 28, 2022):

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.

<!-- gh-comment-id:1111879422 --> @julianfoad commented on GitHub (Apr 28, 2022): 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.
Author
Owner

@binwiederhier commented on GitHub (Apr 28, 2022):

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

<!-- gh-comment-id:1112739739 --> @binwiederhier commented on GitHub (Apr 28, 2022): Re-opening as this _just_ happened to another user. So I suppose I'll add a nicer error message :-D
Author
Owner

@binwiederhier commented on GitHub (Apr 30, 2022):

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

<!-- gh-comment-id:1113879105 --> @binwiederhier commented on GitHub (Apr 30, 2022): 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](https://user-images.githubusercontent.com/664597/166084102-fdc34136-0e62-4892-9545-9a2c0b2d9cce.png)
Author
Owner

@julianfoad commented on GitHub (Apr 30, 2022):

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

<!-- gh-comment-id:1113943152 --> @julianfoad commented on GitHub (Apr 30, 2022): Compared with a crash that's night-and-day better. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#165
No description provided.