The OPFS journal imported mapIndexedDbException from the IndexedDB runtime's
folder, so the two runtimes were not separable as the comments claimed. The
table now lives in browser-file-storage/result.ts next to the DOM table, with
the differences between the two written down; storage/opfs imports nothing
from storage/indexeddb. The storage barrel comment now states the drill's
real scope: it removes the whole bundle, never one folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An older tab that met a schema a newer release had upgraded got
MIGRATION_FAILED / READ_ONLY, but could not even read, and operators were sent
to the migration runbook. The VersionError on open now yields UNSUPPORTED /
ONLINE_ONLY with status INCOMPATIBLE, reads and writes give the same answer,
and the OPFS journal answers the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One corrupt sidecar or receipt stopped every later sweep or prune, so
expired rows stayed on the device and receipts grew until all writes failed
LIMIT_EXCEEDED. Both now leave the corrupt row, count it and report it as one
CORRUPT_DATA observation, and keep a budget they cannot account for as it is.
A malformed budget row in prune now fails as CORRUPT_DATA, not MIGRATION_FAILED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LOGOUT and ACCOUNT_DELETION purged row by row and so needed an open that a
corrupt budget or binding row always rejected, leaving personal rows on the
device. After authority approval, a purge that finds the dataset rejected by
admission now deletes that partition's own database and reports it; healthy
datasets and other partitions are untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two small holes in the IndexedDB kernel (src/adapters/platform/):
- runIndexedDbTransaction: a `fail(x)` after `succeed()` kept the success
candidate, so the abort it triggered was reported as an anonymous
NATIVE_EXCEPTION and `x` was lost. `fail` now replaces a success
candidate; an earlier failure still wins.
- openIndexedDbDatabase: when the open had already settled (caller abort,
terminal BLOCKED, blocked deadline, close) before `onupgradeneeded`
fired, the upgrade still ran and committed the migration. The handler now
aborts the versionchange transaction when the open is already settled.
Tests that encoded the old behavior were updated in this commit:
tests/unit/indexeddb-transaction.test.ts ("an abort after succeed...")
expected NATIVE_EXCEPTION and now expects the caller's failure, and
tests/unit/indexeddb-runtime.test.ts ("times out a blocked upgrade...")
expected the late upgrade to commit and its connection to be closed; it now
expects no schema commit. Both fail without the fix.
Verified: new tests (fail after succeed on a real fake DB does not commit,
first failure still wins, late upgrade after caller abort and after
BLOCKED is aborted without running the upgrade callback) were RED and are
GREEN. All gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SESSION_END, LOGOUT and ACCOUNT_DELETION purges validated every row they
were about to delete and checked the dataset budget counters on each step.
One unreadable record, a record without a valid sidecar, a bad receipt or
a budget counter off by one aborted the batch with CORRUPT_DATA, and the
next batch restarted and hit the same row, so the partition's personal
data never left the device.
The partition purge now deletes by key without making row validity a
precondition. Rows that fail validation are counted and reported as one
CORRUPT_DATA observation per batch through the existing observe channel.
Per-row budget arithmetic is removed; the transaction that finds every
store empty resets the budget row to zero, which also heals a drifted
counter. Between batches the budget can only read high (blocks writes,
never admits). The purge still opens only the partition's own database,
whose name is derived from the partition token. RETENTION_SWEEP is
unchanged and still fails closed on corrupt rows.
Verified: new test "R-5.4 completes a LOGOUT/ACCOUNT_DELETION purge past
corrupt rows" seeds a corrupt record, an invalid sidecar, an invalid
orphan sidecar, an invalid receipt and a drifted budget. Before the fix
the first batch failed CORRUPT_DATA; now the purge reaches COMPLETE, all
rows are gone, the budget is zero, a CORRUPT_DATA observation is emitted,
and a second partition routed through the same factory keeps its row.
Gates: check:architecture, check:types:app/test/web-worker, lint,
test:component pass; test:unit passes except removal-fixture.test.ts,
which needs gitignored release artifacts absent from a fresh worktree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2902 -> 2744줄 (코드 2807 -> 2563, 주석 12 -> 111). 네 번째이자 마지막
사본이다. 손수 abort 리스너가 0이 되어 래칫을 22에서 21로 조인다.
RT-1을 보존했다: 번역기가 CLOSED -> unavailable을 명시 매핑한다. 빠뜨리면
close() 중 진행 중이던 open이 ABORTED로 보고된다.
RT-2는 보존하지 못했다. 사양은 "의미 동일"이라고 썼지만 실제로는 blocked
데드라인 이후 재시도가 새 factory.open()을 띄운다(이행 전에는 안 띄웠다).
커널에 "settle 이후에도 살아 있는 요청"을 알려줄 훅이 없어서 커널을 고치지
않고는 불가능하다. 연결 누수나 데이터 위험은 없고 낭비되는 요청만 는다.
다음 커밋에서 커널에 onSettled를 추가해 복원한다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>