Files
clean-architecture-frontend…/tests/unit
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
..