Commit Graph
9 Commits
Author SHA1 Message Date
DongHyeonkaandClaude Opus 5.5 6cc652610d refactor(storage): move the IndexedDB error table to the kernel exception file (05-11)
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>
2026-09-25 22:52:29 +09:00
DongHyeonkaandClaude Opus 5.5 7f45afac7d fix(storage): report a future IndexedDB schema as INCOMPATIBLE and online-only (05-06)
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>
2026-09-25 22:37:40 +09:00
DongHyeonkaandClaude Opus 5.5 b87ab5ee8e fix(storage): let retention sweep and receipt prune step over a corrupt row (05-05)
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>
2026-09-25 22:33:44 +09:00
DongHyeonkaandClaude Opus 5.5 3e37fbf0ed fix(storage): delete a partition's IndexedDB dataset when an authorized purge cannot open it (05-03)
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>
2026-09-25 22:24:55 +09:00
DongHyeonkaandClaude Opus 5.5 b3a68f70ca fix(storage): let fail() win over succeed() and abort late upgrades (Q-6.5-10)
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>
2026-09-24 13:30:26 +09:00
DongHyeonkaandClaude Opus 5.5 46af07b4fe fix(storage): finish partition purge past corrupt rows (R-5.4)
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>
2026-09-24 12:27:48 +09:00
DongHyeonkaandClaude Opus 5 a91e78f035 refactor: move the IndexedDB runtime onto the kernel
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>
2026-09-16 20:17:19 +09:00
DongHyeonka c6da03369c refactor: 리펙토링 2026-08-01 19:39:59 +09:00
donghyeon-ka 6c52cdb916 feat: 기능 추가 과정중 2026-07-30 15:58:20 +09:00