Repository navigation
ci: test and lint the wasm32 targets again; fix browser panics and dropped pages - #469
Merged
Merged
Conversation
…opped pages The repo split (#231) moved the browser and WASI CI jobs to minigraf-wasm, which only builds the package. Core's own wasm tests stopped running and the wasm32 test build broke unnoticed. - New .github/workflows/wasm.yml: wasm-pack test in headless Firefox and Chrome; unit and integration tests on wasm32-wasip1 under Wasmtime; clippy -D warnings on both wasm targets. - Gate the seven file-backed integration test files that lacked #![cfg(not(target_arch = "wasm32"))], and pid_ns_helper's main. - Ignore on WASI the eight tests that spawn threads or a child process. - BrowserDb: a dirty page that cannot be read is now an error instead of being skipped from the IndexedDB flush while reporting success. No unwrap() in the IndexedDB upgrade callback, the backend handle or the page-buffer lock (a wasm32 panic aborts the instance). IndexedDB keys that are not whole page numbers are rejected, not truncated. - The nine BrowserBufferBackend tests used #[test], which the wasm test runner never runs; they are #[wasm_bindgen_test] now and pass. - wal, storage::verify and storage::dir_sync, and the file-only PersistentFactStorage methods, are not compiled for wasm32, so the wasm32 builds have no warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PersistentFactStorage::with_backend and with_backend_mut exist only for wasm32 with the browser feature, but tarpaulin counted their lines in the native coverage report as uncovered (codecov/patch failed on #469). They now live in a child module, storage/persistent_facts/browser_access.rs, that only browser builds compile, like src/browser itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
adityamukho
added a commit
that referenced
this pull request
Oct 7, 2026
…the IndexedDB flush (#470) checkpoint(), importGraph() and every write collected dirty pages with read_page_raw(id).ok() in a filter_map, so a page that failed to read was silently left out of the flush to IndexedDB while the call reported success. A shared take_dirty_pages helper (the same one v3 has since #469) now returns the read error. No current path leaves a dirty id without a page (ids enter the dirty set only after the page is stored), so this is defensive rather than a fix for observed loss. The browser unit tests did not compile on wasm32 (a duplicate page_cache_capacity from #341/#342, and dir_sync tests using tempfile); both are fixed so the two new regression tests run. Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo split (#231, 2026-05-17) deleted
wasm-browser.ymlandwasm-wasi.yml. Those jobs ran core's own wasm tests:wasm-pack test --headlessin Chrome and Firefox, andcargo test --target wasm32-wasip1under Wasmtime. minigraf-wasm's CI only builds the package, so nothing replaced them. Native clippy never seessrc/browser/, which only compiles for wasm32. Since May the wasm32 test build broke (fixed on v3 in #468), and these problems piled up:CI
New
.github/workflows/wasm.yml, on pushes and PRs tomainandv*:wasm-pack test --headless --{firefox,chrome} --features browsercargo test --target wasm32-wasip1 --lib --testsunder Wasmtime v49.0.2 with--dir .for fixtures, plus a build of the REPL binarycargo clippy --target {wasm32-unknown-unknown --features browser, wasm32-wasip1} -- -D warningsTest build
#![cfg(not(target_arch = "wasm32"))], unlike the other 20:concurrency_test,cursor_test,error_codes_{foundation,storage,wal}_test,fact_log_test,log_writer_test.examples/pid_ns_helper.rsnow has a stubmainon wasm32, like the other examples.udf_test::thread_safety) or a child process (repl::run_public_method_exits_on_non_tty_stdin). WASI can do neither, and a wasm panic aborts the whole run. They are#[cfg_attr(target_os = "wasi", ignore = "...")].Browser fixes (all found by running clippy on the real target)
checkpoint,importGraphand every write flushed dirty pages to IndexedDB via.filter_map(|id| read_page_raw(id).ok() …). A page that failed to read was left out of the flush, and the call still succeeded. A sharedtake_dirty_pagesnow returns the error.unwrap()in the IndexedDBupgradeneededcallback, on the IndexedDB handle, and on the page-buffer lock. On wasm32 a panic aborts the whole instance. The callback now can't fail loudly: a store that wasn't created makes the first transaction return an error instead. The handle code usesOptiondirectly, and the lock usesPoisonError::into_inner(wasm32 aborts on panic, so the lock is never poisoned).tx_id.cast_signed()matches native.js_sys::Date::now()gets a justifiedallow.BrowserBufferBackendtests used#[test], which the wasm runner never runs. They now use#[wasm_bindgen_test]and pass.Warning-free wasm32 builds
wal,storage::verify,storage::dir_syncand the file-onlyPersistentFactStoragemethods are no longer compiled for wasm32, which has no file backend. That removes the ~35 dead-code warnings. The unusedBrowserBufferBackendre-export is gone too.Results (local)
cargo test1,337 passed, 9 ignored (unchanged); fmt andclippy --all-features -D warningsclean.wasm-pack test): 23 passed. Chrome runs in CI only.-D warnings: 0 findings on both wasm targets.main(v2.x) has the same broken test build: the duplicatepage_cache_capacityand thedir_syncgate. These are test-infrastructure fixes, not data-integrity fixes, so per the support policy they stay onv3. The dropped-page bug inBrowserDbalso exists on v2.x.🤖 Generated with Claude Code
https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn