feat(wasm): add feature support for indexedb and sqlite to matrix-sdk-ffi
Expose a choice of session storage in the matrix-sdk-ffi crate. The initial choices are Sqlite (supported on non-Wasm platforms) and IndexedDb (Wasm only). It was agreed though that feature flags make more sense here, and make the code more maintainable.
The existing bundled-sqlite is setup to opt-in sqlite, however several methods for configuring a Sqlite store have been moved onto a sub-builder for organizational reasons.
This PR is stacked on top of https://github.com/matrix-org/matrix-rust-sdk/pull/5211/files, I will rebase it against main when that has landed.
Corresponding PR for complement-crypto: https://github.com/matrix-org/complement-crypto/pull/195
- [X] Public API changes documented in changelogs (optional)
Signed-off-by: Daniel Salinas
Waiting on https://github.com/matrix-org/matrix-rust-sdk/pull/5211 to be merged before reviewing this one.
Would be nice to get opinions on the new session_store and client_builder changes. Those are wholly new, and structural feedback would be very welcome
Can this one be rebased as well?
Yep, rebased it to adopt the Cargo.toml changes. This PR now concerns only the configuration of the session store.
Let me know if a different approach would be preferred here, adding sub-builders seemed more self-documenting than having a large number of 'optional' methods on the main builder, but happy to do it a different way if you prefer.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 90.18%. Comparing base (08e1d38) to head (5c93af9).
:warning: Report is 1251 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5245 +/- ##
=======================================
Coverage 90.18% 90.18%
=======================================
Files 334 334
Lines 104822 104822
Branches 104822 104822
=======================================
+ Hits 94534 94538 +4
+ Misses 6236 6232 -4
Partials 4052 4052
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Here is a corresponding complement-crypto PR: https://github.com/matrix-org/complement-crypto/pull/195
I will address the feedback myself and will merge the PR.
Closing in favor of https://github.com/matrix-org/matrix-rust-sdk/pull/5811.