matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

feat(wasm): add feature support for indexedb and sqlite to matrix-sdk-ffi

Open zzorba opened this issue 6 months ago • 6 comments

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

zzorba avatar Jun 18 '25 14:06 zzorba

Waiting on https://github.com/matrix-org/matrix-rust-sdk/pull/5211 to be merged before reviewing this one.

Hywan avatar Jun 18 '25 15:06 Hywan

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

zzorba avatar Jun 18 '25 16:06 zzorba

Can this one be rebased as well?

poljar avatar Jun 19 '25 15:06 poljar

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.

zzorba avatar Jun 19 '25 22:06 zzorba

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.

codecov[bot] avatar Jun 19 '25 22:06 codecov[bot]

Here is a corresponding complement-crypto PR: https://github.com/matrix-org/complement-crypto/pull/195

zzorba avatar Jun 20 '25 14:06 zzorba

I will address the feedback myself and will merge the PR.

Hywan avatar Aug 19 '25 08:08 Hywan

Closing in favor of https://github.com/matrix-org/matrix-rust-sdk/pull/5811.

Hywan avatar Oct 29 '25 11:10 Hywan