Skip to content

Configurable VFS for matrix_sdk_sqlite compiled to WASM targets#6365

Draft
NoManColonies wants to merge 32 commits intomatrix-org:mainfrom
NoManColonies:configurable-vfs
Draft

Configurable VFS for matrix_sdk_sqlite compiled to WASM targets#6365
NoManColonies wants to merge 32 commits intomatrix-org:mainfrom
NoManColonies:configurable-vfs

Conversation

@NoManColonies
Copy link
Copy Markdown

@NoManColonies NoManColonies commented Mar 28, 2026

Split from (#6329)

This PR adds support for configuring different VFS backends when matrix_sdk_sqlite is compiled for WASM targets.

Summary of changes

  • Change default VFS to in-memory (instead of OPFS)
  • Add vfs-opfs-sahpool feature to select OPFS as the VFS backend
  • Add vfs-relaxed-idb feature to select IndexedDB as the VFS backend
  • vfs-opfs-sahpool and vfs-relaxed-idb are mutually exclusive
  • Update cargo xtask ci to run the test suite for each configurable VFS

Notes

  • Defaulting to in-memory avoids dedicated worker context assumptions for WASM users
  • OPFS and IndexedDB can be explicitly enabled via feature flags

  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.
    • This PR description was machine translated/assisted

Signed-off-by: Geng Kongpop geng@finnomena.com

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.85%. Comparing base (85b8c83) to head (33660e2).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/crypto_store.rs 0.00% 0 Missing and 1 partial ⚠️
crates/matrix-sdk-sqlite/src/state_store.rs 75.00% 0 Missing and 1 partial ⚠️
crates/matrix-sdk-sqlite/src/utils.rs 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6365      +/-   ##
==========================================
- Coverage   89.88%   89.85%   -0.04%     
==========================================
  Files         376      376              
  Lines      103093   103097       +4     
  Branches   103093   103097       +4     
==========================================
- Hits        92670    92637      -33     
- Misses       6863     6884      +21     
- Partials     3560     3576      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 28, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing NoManColonies:configurable-vfs (33660e2) with main (85b8c83)

Open in CodSpeed

Geng Kongpop added 26 commits March 31, 2026 00:54
chore: address breaking changes from rusqlite

feat: support alternative v/fs for wasm environment

feat: support non-send future for wasm environment

fix: solve incorrect error transformation

feat: WIP support connection pool in wasm environment

fix: use full-path method call for wasm environment + other fixes for
wasm

fix: more wasm related fixes

feat: use RefCell to simulate interior-mutability in wasm environment

fix: use implicit borrow instead of explicit call to `as_ref()`

fix: more wasm related fixes

fix: resolve ambiguity between lock guard and ref cell implicit
reference + more wasm fixes

fix: resolve wasm related lifetime issues

chore: turn on serde feature for web time when compiled as wasm32 target

chore: ran cargo check to verify Cargo.lock file

chore: fix comment formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant