Check native and Wasm SQLite3MC open each other's files, under Node and in browsers - #12
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: LucaCappelletti94/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 3 3
Branches 3 3
=========================================
Hits 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f860653 to
ba307c9
Compare
|



The same amalgamation reaches users natively through a -sys crate and in the browser through sqlite-wasm-rs, which compiles it with its own flags. Until now CI only checked that the Wasm build could reopen its own files under Node, so a flag change that made browser-written databases unreadable natively, or a failure that shows only in a real browser or on OPFS, passed every check.
A native writer built from the packaged sources now writes one database per cipher SQLite3MC offers. Those files are compiled into the Wasm tests, which read them under Node, in headless Chrome and Firefox, and on OPFS sahpool in a dedicated worker. The Wasm tests then write one database per cipher in each of those places and print it as base64, since a browser has no filesystem, and the native side decodes and opens every one. Every file must refuse a wrong key and a missing cipher setting, and no page may show plaintext. Building only the Wasm side with a different default ChaCha20 format now fails in both directions, while the old Wasm-only round trip still passed.
The interop job replaces the old wasm job and keeps its checks, so the ruleset needs the required context "sqlite-wasm-rs builds the packaged amalgamation for Wasm" swapped for the two new job names before this merges. On OPFS, SQLite3MC only encrypts after sqlite3mc_vfs_create wraps the pool, which the sahpool test does the way an app would have to.