Skip to content

db.info() hangs in Safari private browsing #9087

@teleganov

Description

@teleganov

It seems that a recent update of Safari may have broken PouchDB in private browsing mode. It might be version 18.4 as I am having no issues with this in the iOS 18.3 simulator but my desktop and mobile browsers (18.4 and 18.5 respectively) are both not working in Private Browsing mode.

Specifically, it seems to silently hang on any async call, including info(). No error is logged, and it is able to create the database just fine, but if you try to do anything with it, it just hangs.

Here is an example app in CodePen which inits a database and tries to make some changes and logs things as they occur:
https://codepen.io/teleganov/pen/OPVNOYV

In non-private browsing mode the log shows:

10:29:46 PM: Page loaded, click "Test PouchDB" to run the test
10:29:46 PM: PouchDB version: 9.0.0
10:29:46 PM: ✓ PouchDB is loaded
10:29:46 PM: ✓ PouchDB database 'test-db' created
10:29:46 PM: ✓ Database info retrieved
10:29:46 PM: - Adapter: idb
10:29:46 PM: - Doc count: 8
10:29:46 PM: - Update sequence: 10
10:29:46 PM: ✓ Document created with ID: test-doc-1748831386435
10:29:46 PM: - Rev: 1-adbb411962c9cd5e63b8958336356134
10:29:46 PM: ✓ Document retrieved: Hello PouchDB!
10:29:46 PM: ✓ Document updated, new rev: 2-8a904b9e0e168da39fa90b9b12640d9f
10:29:46 PM: ✓ All documents queried: 9 total
10:29:46 PM: ✓ Batch insert: 3 documents created
10:29:46 PM: ✓ Final doc count: 12
10:29:46 PM: ✓ Final update sequence: 15
10:29:46 PM: ✓ Database closed
10:29:46 PM: ✓ Database reopened - doc count: 12
10:29:46 PM: ✓ Data persisted: Hello PouchDB!
10:29:46 PM: ✓ Database closed again
10:29:46 PM: 🎉 PouchDB test completed successfully!

In private browsing mode:

10:32:23 PM: Page loaded, click "Test PouchDB" to run the test
10:32:23 PM: PouchDB version: 9.0.0
10:32:24 PM: ✓ PouchDB is loaded
10:32:24 PM: ✓ PouchDB database 'test-db' created

The first info() call never resolves in private browsing mode.

I did find this CVE in the 18.4 security release notes with the following comments:

Impact: A malicious website may be able to track users in Safari private browsing mode
Description: This issue was addressed through improved state management.

At first I wanted to blame Safari but then I tested out this CodePen which uses IndexedDB exclusively:
https://codepen.io/teleganov/pen/qEdZpEL

This one works fine in both private and non-private browsing modes. So something about PouchDB specifically is not playing nicely with Safari 18.4+ private browsing mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions