Conversation
|
Thanks for the PR, I think I need to spend some time looking into this. |
|
Thanks, take your time |
|
Thanks for working on this! I’ve decided to remove relaxed_idb in the next major release because I’m not comfortable with its durability guarantees for database storage. I appreciate the time and effort you put into it. You can still implement your own VFS using the traits provided by rsqlite-vfs; it should be fairly straightforward to maintain this implementation separately. JSPI may also be a better direction: it could let SQLite’s synchronous VFS calls wait for asynchronous storage operations to complete. wasm-bindgen now has experimental JSPI support (https://wasm-bindgen.github.io/wasm-bindgen/reference/jspi.html), so that seems worth exploring. |
|
Wow great. I'll take a look, thank you |
Relaxed IndexedDB currently queues SQLite sync notifications without an observable completion. This patch adds an ordered barrier for callers that must confirm backing IndexedDB durability before publishing state.
The implementation retains dirty blocks across failed transactions, snapshots bytes with file and block generations, bounds failure tracking, retries only safe sync failures, and permanently poisons the barrier after destructive delete/clear failures. The browser test utility injects deterministic failures to cover error propagation and recovery ordering.
Validation:
cargo fmt --all -- --checkcargo check -p sqlite-wasm-vfs --target wasm32-unknown-unknowncargo check --manifest-path tests/Cargo.toml --target wasm32-unknown-unknown --tests