Skip to content

IndexedDBManager.prune keeps live sibling databases open, which blocks their deletion #137

Closed

Description

@Nawid3333

Severity: low

Where: chrome/player/network/IndexedDBManager.mjs (prune)

What happens

const db = await IndexedDBManager.requestDB(database.name, false);
try {
  const updatedTime = await IndexedDBManager.getValue(db, 'metadata', 'updated_time');
  if (!updatedTime || Date.now() - updatedTime > 10000) throw new Error('Stale');
} catch (e) {
  db.close();
  await IndexedDBManager.deleteDB(database.name);
}

db.close() runs only in the stale branch. A fresh sibling's connection is never closed and has no onversionchange handler.

Failure scenario

Tab A (on the IndexedDB backend, i.e. OPFS and the Cache API both refused) prunes while tab B is alive: A holds B's faststream-temp-* open; B's close() -> deleteDatabase is blocked, wrapRequest times out after 5 s, and the database stays on disk until A closes. Only reachable on the third backend.

Suggested fix

db.close() in a finally after the staleness read.

Confidence: high.


From a line-by-line code review of the tree at 41363fd (2026-10-02). Each claim above was checked against the source before filing; the reproduction steps and line references are as of that commit.


Generated by Claude Code

Activity

  1. added
    bugSomething isn't working
    code-reviewFound by the 2026-10-02 line-by-line review
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-reviewFound by the 2026-10-02 line-by-line review

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions