perf: port sqlite-sync network updates to wasm#4
Merged
Conversation
Read CloudSync ticket response headers in the wasm network adapter and send the cached ticket on later API requests while preserving bearer authentication. Use fetch->numBytes when copying loaded response bodies, report statusText with strlen(), and handle null fetch results to keep error lengths and failures accurate.
Gate ticket response header reads to completed HTTP responses and use the CloudSync session token buffer size for cached tickets. Skip overlong cached tickets instead of truncating them and guard fetch response sizes before casting to size_t.
Define the sqlite-wasm wrapper version in wasm.c so wrapper-level changes can be tracked alongside module versions. Extract and validate SQLITEAI_WASM_WRAPPER_VERSION during build, producing versions such as 3.50.4-wasm.1.0.0-sync.1.0.20-vector.1.0.0-memory.1.2.2.
Register a wasm_version() SQL function backed by SQLITEAI_WASM_WRAPPER_VERSION so generated package versions can be matched by runtime checks. Update the browser version smoke test to include the wasm wrapper segment between SQLite and module versions.
Drop the sqlite3_wasm_extra_init startup fprintf because Emscripten routes stderr to console.error in browsers. This prevents successful package initialization from appearing as a JavaScript console error.
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.
Summary
SQLITEAI_WASM_WRAPPER_VERSIONinwasm.c.Verification
git diff --check.emcc -fsyntax-only ... wasm.c.bash -n build.sh.