Commit Graph
8 Commits
Author SHA1 Message Date
ldm0 b8190ee87d refactor(indexeddb): address SQL schema by stable IDs
Use the persisted StoreId and IndexId in SQL commands, transaction scopes and renderer handles. Reserve IDs without waiting for the SQL owner and recover their counters with committed disk metadata.

Remove name-based request targets, separate renderer identity tokens and cursor name refresh. Cover concurrent reservations, abort, idle reconnect, catalog recovery, restart, stale IDs and old-name reuse.
2026-11-13 01:39:46 +08:00
ldm0 f802862181 refactor(indexeddb): use Tokio database owners and timed connection cleanup
Replace fixed worker shards and Lane locks with one async worker and one FIFO owner per database. Move synchronous SQL, connection work and catalog operations to the blocking pool. Drain accepted work and await final owner receipts before retirement or runtime teardown.

Use a single maintenance task with a short idle grace and at most one pending check per database, so slow owners cannot stall later rounds. Retry transient open failures in the same prepared generation while preserving terminal missing-file checks. Cover lifecycle races, low-FD creation and recovery, and single-worker host shutdown without new shared resource budgets.
2026-10-30 20:27:08 +08:00
ldm0 b52ca510ea fix(indexeddb): preserve UTF-16 schema names through SQLite
Carry store and index names as IndexedDbName code units through WebIDL DOMString16 conversion, transaction scopes/admission, metadata, queued operations, cursors and DOMStringList. Store labels as ordered UTF-16BE BLOBs in SQLite schema v3; migrate known v1/v2 tables transactionally while preserving stable ids, records, indexes, generators and logical usage. Reuse the database-name codec and existing SQL command FIFO. Add exact surrogate/replacement/NUL/astral name operations in Window, iframe and Worker, plus native disk restart and malformed-label migration rollback/retry tests. This prerequisite supplies the lossless name model needed by the separate index/store rename setters.
2026-10-30 17:50:36 +08:00
ldm0 273ce0519d refactor(indexeddb): remove shared in-flight memory budgets 2026-10-30 03:31:32 +08:00
ldm0 d8755b9ff9 refactor(indexeddb): replace task tickets with one data byte budget 2026-10-30 03:31:32 +08:00
ldm0 29bc89071c refactor(indexeddb): require SQL metadata budgets and refresh benchmarks 2026-10-30 03:31:32 +08:00
ldm0 26a50c0116 refactor(indexeddb): remove JSON backend and whole-database working copies
Keep IndexedDbManager as the owner of a required SQLite service, with committed usage and shutdown access. Remove the synchronous storage API, legacy persistence and transaction data copies.

Delete bucket IDB owner-key imports while preserving durable bucket identities, pending deletion and CacheStorage recovery. Port storage fixtures and the native benchmark to actual SQL connections and commands; retain generic key/direction tests and port cold-reopen and invalid-key transaction contracts to SQLite.

Validation: cargo fmt --all; workspace Clippy with all targets/features and -D warnings; nextest 21,815 passed,19 skipped;229 native/storage tests passed all20 stress iterations;memory/disk benchmark smoke passed.
2026-10-30 03:31:32 +08:00
ldm0 4ad79c72ae feat(indexeddb): define SQLite schema and binary key formats 2026-10-30 03:31:32 +08:00