mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 21:04:04 +02:00
Gate yaak-web to wasm32 and make the DB lock cover every worker
CI runs `cargo test --all`, which compiled yaak-web for the host and failed in sqlite-wasm-rs's C shim. The crate is now `#![cfg(target_arch = "wasm32")]` with its browser-only dependencies target-scoped, so it is empty natively. Review caught a race in the worker fallback: a shared worker that starts after the tab has given up on it and taken a dedicated worker would open the database with no lock. The Web Lock now guards every worker, shared or not — requested with a short timeout so a reloading tab's dying predecessor is waited out, then reported. The tab also closes the port it abandoned. Verified in production builds: 8/8 shared and 3/3 dedicated reloads render, and a second tab in dedicated mode is told the database is in use.
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user