feat(storage): IndexedDB archive store + download ledger (Closes #48)#198
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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."accounts,conversations,harvest_runs,extraction_queue,settings.openDb,upsertConversation,getConversation,listConversations,enqueueExtraction,dequeueNext,markDownloaded,markDownloadError,statusCounts,recordRun,get/setSetting.onupgradeneeded.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 viafake-indexeddb(new devDependency), run in the node environment (jsdom lacksstructuredClone). Full suite: 304 passing.Note
package.json/package-lock.jsonalso persist two already-installed operator devDeps (playwright-extra,puppeteer-extra-plugin-stealth, used by the e2e discovery tooling) that couldn't be separated from thefake-indexeddbdeclaration without disturbing uncommitted working-tree state.Closes #48