Commit Graph
17 Commits
Author SHA1 Message Date
ldm0 3b76d63b3a refactor(sqlite): unify writeback failure handling 2026-11-01 04:03:38 +08:00
ldm0 a598b45216 refactor(storage): remove unused persistence APIs 2026-11-01 04:03:38 +08:00
ldm0 87d86218b2 refactor(storage): remove derived localStorage metadata and early view flushes 2026-11-01 04:03:38 +08:00
ldm0 c5b6267006 fix(storage): count UTF-16 keys and values toward Web Storage quota 2026-11-01 04:03:38 +08:00
ldm0 f1ab617cf2 refactor(storage): remove automatic SQLite writeback retries
Discard failed Cookie batches without requeueing, following Chromium's commit
behavior. Preserve the live canonical jar and the normal 30-second/512-operation
schedule for new mutations, and report persistence errors without replaying the
old batch on flush/close.

Remove backoff state, error classification, and per-call failure admission.
Retain explicit-flush recovery only for localStorage, whose absolute area
metadata must stay paired with its failed entry deltas.

Cover idle failures, subsequent batch deadlines and operation thresholds,
non-replaying flush/close, Cookie jar versus SQL state, and actual SQLITE_FULL
recovery by explicit localStorage flush.
2026-11-01 04:03:38 +08:00
ldm0 42680d286e refactor(storage): apply idempotent deltas without existence tracking
Keep the latest Put or Delete for each key rather than eliding transient-row
deletes. Remove existed from Cookie and localStorage deltas and Cookie mutation
observers, then remove the shared uncertain-commit correction hook. Preserve
Cookie Touch composition and atomic, idempotent retry behavior.

Replace optimization-specific assertions with actual SQL replay tests covering
a published put followed by deletion and clear followed by a newer put.
2026-11-01 04:03:38 +08:00
ldm0 59743d9466 refactor(storage): remove the legacy JSON Web Storage backend
Keep SQLite for persisted localStorage and memory for sessionStorage. Remove
the unused JSON backend, serialization types, constructors, reexports, and
dependencies. Explicit external data imports still target SQLite; older JSON
profile files remain untouched without automatic migration.
2026-11-01 04:03:38 +08:00
ldm0 f2c2b89266 refactor(storage): remove unused origin Web Storage usage aggregation
Remove the origin-wide Web Storage quota API and its unused SQLite key listing.
CDP and navigator quota queries already exclude Web Storage. Retain single-area
metadata reads and the indexed entry-count query needed for cold origin clears.
2026-11-01 04:03:38 +08:00
ldm0 18c379855a perf(storage): clear cold localStorage areas without loading entries
Use area entry counts to accept clear deltas directly. Keep empty logical maps
pinned until those deltas commit so later reads cannot reload stale SQL rows.
Order deletion and later puts through the existing writeback FIFO and retain
live areas across metadata queries and older commit acknowledgements.

Cover cold value corruption, zero-byte nonempty areas, repeated clear events,
subsequent puts, restart persistence, and an older queued commit racing clear.
2026-11-01 04:03:38 +08:00
ldm0 19863df019 perf(storage): query localStorage usage from area metadata
Read persisted usage without materializing cold key/value maps, and overlay
pinned live area sizes for uncommitted updates, additions, and clears. Use a
bounded storage-key index range instead of applying substr to every row.

Verify cold maps remain uninitialized, dirty sizes replace persisted metadata,
and the actual SQLite query plan uses equality and bounded index searches.
2026-11-01 04:03:38 +08:00
ldm0 d0a8d7ae19 fix(storage): retry recoverable SQLite writeback failures
Preserve SQLite error codes and retry atomic batches after transient resource,
locking, and I/O failures. Back off from one second to a capped sixty-second
interval without letting new mutations bypass the delay. Successful commits
restore localStorage admission; permanent errors still require explicit retry.

Verify bounded scheduling with virtual time and real SQLITE_FULL recovery
without a second flush, including restart persistence and new writes.
2026-11-01 04:03:38 +08:00
ldm0 6584ff274f refactor(storage): keep SQLite databases directly in partition directory 2026-11-01 04:03:38 +08:00
ldm0 5e6482996e feat(storage): open Cookie and localStorage databases on first use 2026-11-01 04:03:38 +08:00
ldm0 b5cf04a307 refactor(storage): switch SQLite namespaces without JSON migration 2026-11-01 04:03:38 +08:00
ldm0 6708ecf8ac feat(profile): stage and recover atomic SQLite cookie and localStorage migration 2026-11-01 04:03:38 +08:00
ldm0 03e09d240c feat(storage): add asynchronous SQLite Web Storage areas and flush barriers 2026-11-01 04:03:38 +08:00
ldm0 5e4ce39c51 refactor(storage): extract renderer-independent Web Storage state 2026-11-01 04:03:38 +08:00