Skip to content

feat(storage): IndexedDB archive store + download ledger (Closes #48)#198

Merged
martymcenroe merged 1 commit into
mainfrom
feat/batch-download-storage
Jul 9, 2026
Merged

feat(storage): IndexedDB archive store + download ledger (Closes #48)#198
martymcenroe merged 1 commit into
mainfrom
feat/batch-download-storage

Conversation

@martymcenroe

Copy link
Copy Markdown
Owner

What

Adds extensions/src/storage/db.js — the local archive/ledger the in-extension batch-download feature reads to resume, skip already-downloaded conversations, and report progress. This is the "database of what you downloaded."

  • Five IndexedDB object stores: accounts, conversations, harvest_runs, extraction_queue, settings.
  • Promise API: openDb, upsertConversation, getConversation, listConversations, enqueueExtraction, dequeueNext, markDownloaded, markDownloadError, statusCounts, recordRun, get/setSetting.
  • Versioned schema via onupgradeneeded.
  • Resume-safe: a metadata re-harvest updates title/url but never clobbers download state (download_status, zip_name, downloaded_at).

The module is not yet wired into manifest.json (inert until the enumerate/worker/UI pieces land), so the shipped extension's behavior is unchanged — no version bump.

Tests

tests/storage.test.js — 10 tests against real IndexedDB via fake-indexeddb (new devDependency), run in the node environment (jsdom lacks structuredClone). Full suite: 304 passing.

Note

package.json / package-lock.json also persist two already-installed operator devDeps (playwright-extra, puppeteer-extra-plugin-stealth, used by the e2e discovery tooling) that couldn't be separated from the fake-indexeddb declaration without disturbing uncommitted working-tree state.

Closes #48

Adds extensions/src/storage/db.js — the local archive/ledger the batch-download
feature reads to resume, skip already-downloaded conversations, and report
progress. Five object stores (accounts, conversations, harvest_runs,
extraction_queue, settings), a Promise API, versioned schema, and resume-safe
upsert (a metadata re-harvest never clobbers download state). Tested against
real IndexedDB via fake-indexeddb (new devDep); 10 tests, run in the node env.

Note: package.json also persists two already-installed operator devDeps
(playwright-extra, puppeteer-extra-plugin-stealth) that could not be separated
from the fake-indexeddb declaration without disturbing uncommitted state.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@cerberus-az cerberus-az Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: all required checks passed. 🤖

@martymcenroe
martymcenroe merged commit ab13154 into main Jul 9, 2026
2 checks passed
@martymcenroe
martymcenroe deleted the feat/batch-download-storage branch July 9, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(storage): IndexedDB schema + versioned migrations (accounts, conversations, harvest_runs, extraction_queue)

1 participant