Files
LumaWeb/experiments/0004-storage-design/README.md
T
wt 0e2b3098df S00-005: Select idb and verify transactional storage failure policies
Changes: Propose ADR 0004 comparing native IndexedDB, idb and Dexie; select idb 8.0.4 with account, transaction, quota, upgrade and key ownership policy. Repair rollback and add injected quota/blocked upgrade checks, exact wrapper lock, runtime guard, license texts and reproduction notes. Preserve historical recovery artifacts.
Validation: Fresh-cache npm ci and npm run check passed on Node 24.21.0/npm 11.19.0; manifest, HTTPS/SHA512 and license checks passed. make check passed 72 tooling tests; tasks.py validate and git diff --check passed. Native browser quota, disk durability and process restart were not tested; ADR remains proposed for independent QA.

Task: S00-005
Agent: auto-storage-0ce544ac4b40
Role: storage
Action: claim
Status: review

Task title: Выбрать IndexedDB wrapper и migration policy
2026-10-15 18:33:15 +07:00

42 lines
2.4 KiB
Markdown

# Storage design experiment (S00-005)
Synthetic fixtures only. No app adapter, shared contract, secrets or real messages.
ADR: `docs/decisions/0004-storage-design.md` (proposed pending independent QA).
`RECOVERY.md` preserves the earlier interruption inventory; its missing-output
notes are historical, superseded by this task's code and evidence.
From this directory, using Node 24.21.0 and bundled npm 11.19.0:
```sh
npm ci --ignore-scripts --no-audit --no-fund --cache /tmp/luma-storage-review-cache --fetch-retries=0 --fetch-timeout=15000
npm run check
```
`check` refuses other Node/npm versions. Lockfile pins idb 8.0.4 (ISC) and
fake-indexeddb 6.2.5 (Apache-2.0), with HTTPS URLs/SHA512 integrity and no transitives.
`.npmrc` retains verified TLS. Runtime dependencies are isolated to this experiment.
Full license texts are in `licenses/`; production distributions must preserve
idb's notice. fake-indexeddb is a test fixture and must not enter production paths.
- `src/rollback.mjs`: actual unique-index ConstraintError, failed upgrade rollback,
complete schema/data assertions, corrected retry and same-process connection reopen.
- `src/quota-blocked.mjs`: explicitly injected quota error after successful requests,
multi-store abort/checkpoint invariance, account B preservation, retry/reopen;
held old connection, versionchange/blocked and release; stale-version refusal.
- `src/_probe.mjs`: preserved exploratory native-API fixture, outside check suite.
Each fixture uses its own synthetic database name and deletes it before/after.
The blocked scenario has a 3-second failure deadline. CI should impose an overall
process timeout as well. Exceptions/assertion failures cause nonzero exit;
PASS text is printed only after the corresponding assertions.
fake-indexeddb is in memory. Quota fault injection checks the policy response and
real fixture transaction abort, not a native request/commit QuotaExceededError.
Reopen is not process restart. No real browser was available (empty inventory).
Browser multi-tab, physical quota/disk failure, crash/restart, eviction and
StorageManager permission/persistence grants remain external integration checks.
Future browser testing should use a disposable isolated origin/profile, repeat
the schema and blocked scenarios on native IDB, then validate request/commit
quota failures and restart persistence without filling a user's normal origin.
No TLS, CORS or encryption workaround is required or authorized.