fix(storage): hold a per-transaction lock so reconcile skips a live OPFS put (05-01)

Reconcile cleaned up any incomplete journal row, including a put still
running in another tab, and the put then reported success for deleted files.
Put and delete now hold a Web Lock per transaction from begin to return;
reconcile takes those locks with ifAvailable, re-reads the page under them
and reports the rows it skipped (D-3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-25 22:09:30 +09:00
co-authored by Claude Opus 5.5
parent 926f448fce
commit 8fc816ee25
5 changed files with 661 additions and 205 deletions
@@ -100,6 +100,11 @@ export type OpfsReconciliationReport = Readonly<{
| "STAGING_STATE_UNREADABLE";
moreTransactionsAvailable: boolean;
deadlineReached: boolean;
/**
* 05-01. Rows whose owner still holds the per-transaction lock. They are
* a live put or delete, not debris, and are left for a later reconcile.
*/
skippedLiveTransactions: number;
}>;
export type OpfsPolicyMaintenanceReport = Readonly<{