Commit Graph

101 Commits

Author SHA1 Message Date
Kévin Commaille
f883293168 chore: Update Ruma
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-01-11 16:05:02 +01:00
Jonas Platte
f4bfbdf97d chore: Upgrade base64 2023-01-10 10:19:02 +01:00
Jonas Platte
2e30e11101 refactor: Use workspace dependencies for more crates 2023-01-10 10:19:02 +01:00
Matthew Hodgson
b026d90bcf fix(sdk): Handle to-device sliding sync extension correctly
Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-01-02 18:00:38 +00:00
Jonas Platte
a5080b6ed9 chore: Upgrade Ruma 2022-12-19 13:50:02 +01:00
Jonas Platte
34d458d3a3 chore: Upgrade UniFFI 2022-12-14 12:03:13 +01:00
Jonas Platte
3d22b6d5a4 chore: Upgrade Ruma 2022-11-29 15:37:18 +01:00
Benjamin Kampmann
d3ff402813 feat(sliding-sync): Offline caching for Sliding Sync & session recovery (#1193)
With these changes, the user of sliding sync can configure the SlidingSync-Builder to store and recover the state from storage. For that they should call cold_cache("my-sliding-sync-key") with their preferred storage location during setup time on SlidingSyncBuilder. If a cached version is found under that key, the internal state of the rooms-list as well as each view found (identified by their name) will be set from storage immediately - allowing the user to show the last cached state. The Builder then also uses the same key to store its latest state after every update received from remote.

👉 Note on room list:
As we store a disconnected state, we are saving all RoomList entries as either Empty or Invalidated. This allows for an easier updating when the server comes back with results, as we don't track the ranges in cache - in the view of the server, we haven't seen anything yet.

👉 Note on timeline events:
This does store all existing timeline events - initial and seen during the session (as we keep track of them right now) - and will recover that state. However, as we can't be sure wether we have gaps in the timeline, the timeline items are reset upon receiving updates for them from the server.

👉 Note on (full-sync-)view:
While we are caching the server returned results (view list, room count and room info) as is, we are not caching the internal state (whether we are catching up) nor the ranges (as they are likely to be out of date) - those will be acting the same way you configured them, just with preloaded results. So for a full-sync-view, it will still do requests in batches and replace the corresponding set of rooms. Which could mean you might see the same room appear twice, though the cached one would be marked as invalidated. This might be problematic if the list the UI shows is longer than the batches fetched, but would be resolved quickly when catching up.

👉 On recovery:
When the sliding sync receives a M_UNKNOWN_POS, indicating the server has expired our session, sliding sync now transparently retries with up to three times to restart the sliding sync with full set of extensions and the latest views at their existing windows, the current room state is held. For full sync this starts a new sync-up with the existing room list staying intact. This also works from the offline at start.
2022-11-28 18:01:04 +00:00
Jonas Platte
c3aa03e486 chore: Add reldbg profile and use it for matrix-sdk-ffi iOS builds 2022-11-16 09:59:06 +01:00
Jonas Platte
51798e90bd chore: Add dbg profile and improve profile comments 2022-11-16 09:59:06 +01:00
Jonas Platte
826705c174 chore: Bump MSRV to 1.65 2022-11-15 14:57:46 +01:00
Jonas Platte
4dc0e0ef3c chore: Upgrade Ruma 2022-11-14 15:01:53 +01:00
Jonas Platte
99e621a82b chore: Upgrade UniFFI 2022-11-03 09:48:41 +01:00
Jonas Platte
a6ca114bac chore: Upgrade UniFFI 2022-11-02 16:21:16 +01:00
Jonas Platte
eddf202a76 chore: Upgrade UniFFI 2022-10-27 11:27:28 +02:00
Jonas Platte
01dc166293 chore: Upgrade UniFFI 2022-10-20 12:53:09 +02:00
Jonas Platte
0cfc7540cf refactor: Use workspace dependencies for tracing 2022-10-18 19:24:22 +02:00
Jonas Platte
f25af209e1 refactor: Use workspace dependencies for zeroize 2022-10-18 13:38:05 +02:00
Jonas Platte
e6891addfb refactor: Use workspace dependencies for vodozemac 2022-10-18 13:38:05 +02:00
Jonas Platte
f57b7782f4 refactor: Use workspace dependencies for ruma 2022-10-18 13:38:05 +02:00
Benjamin Kampmann
5e621b7132 fix!: Switch to uniffi 0.21.0 and workspace-wide dependencies
Upgrade MSRV to 1.64, the first stable release to support workspace-wide depenendencies:
https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
2022-10-17 15:38:04 +01:00
Benjamin Kampmann
4c7ddd7512 refactor: move examples from crates/matrix-sdk into separate crates in examples/ 2022-08-02 15:06:04 +02:00
Benjamin Kampmann
2d21c30639 Merge remote-tracking branch 'origin/main' into gnunicorn/issue833 2022-08-01 13:28:28 +02:00
Benjamin Kampmann
c27016b2e7 testing: fix review grumbles 2022-08-01 13:01:50 +02:00
Jonas Platte
a21ac5d6e4 Disable debug-info for the dev profile 2022-07-29 11:28:47 +02:00
Benjamin Kampmann
e3febd6f1f refactore(test): move testing out of regular build environment 2022-07-18 14:37:51 +02:00
Damir Jelić
47cfac7f4c test: Optimize sha2 even in debug builds
This makes the tests finish on my machine twice as fast. This works
mainly because some tests utilize pbkdf2 to derive a key from a
passphrase.
2022-07-08 18:47:36 +02:00
Ivan Enderlin
ecc28efd53 chore(bindings): Move matrix-sdk-ffi and matrix-sdk-crypto-ffi into the bindings/ directory. 2022-06-23 11:31:59 +02:00
Ivan Enderlin
8cd7fa9fb0 chore: Implement feedback. 2022-06-22 16:03:37 +02:00
Ivan Enderlin
8db58986fb chore(bindings): Move crypto-nodejs and crypto-js into the bindings/ directory.
`matrix-sdk-crypto-nodejs` and `matrix-sdk-crypto-js` are no longer
default members of the Cargo virtual workspace. The Github Actions
workflows for the bindings now live in a `bindings_ci.yml` files
(ideally, it should be in a subdirectory,
`.github/workflows/bindings/ci.yml` but it doesn't work).
2022-06-22 11:54:49 +02:00
Jonas Platte
7f81e7c61b chore: Optimize quote even in debug mode 2022-06-03 14:48:48 +02:00
Ivan Enderlin
6d7573dced chore: Add missing new lines at the end of files. 2022-05-31 10:06:35 +02:00
Ivan Enderlin
84fe78bab3 Merge branch 'main' into feat-crypto-wasm 2022-05-31 08:39:29 +02:00
Ivan Enderlin
0fe0910fea feat(crypto) Reduce Wasm binary size by enabling LTO. 2022-05-31 08:35:09 +02:00
Johannes Becker
5f92113627 chore: Use resolver2 for workspace 2022-05-17 10:24:28 +02:00
Jonas Platte
e2aab504fb Move sled state inspector into a separate crate 2022-03-31 14:26:32 +02:00
Jonas Platte
9567f8f28f Move the crypto benchmarks into a separate crate
Avoids issues from circular dev-dependency.
2022-03-31 14:26:32 +02:00
Jonas Platte
b7a4ca4cff Create an xtask crate for workspace task automation
Initially covering:

* Building docs
* Nightly CI jobs
2022-03-03 11:10:28 +01:00
Jonas Platte
bc0c8d529e Simplify Cargo workspace configuration 2022-03-02 14:34:22 +01:00
Damir Jelić
70ab0f446d chore: Sort the deps in our Cargo.toml files 2021-09-14 16:38:33 +02:00
Damir Jelić
af74988a83 chore: Rename the crate folders to use dashes instead of underscores 2021-09-14 16:38:33 +02:00
Damir Jelić
041ef66c01 chore: Move the crates into a subfolder 2021-09-14 11:59:21 +02:00
Damir Jelić
305766955b matrix-sdk: Add a crate to generate and parse QR codes
This patch adds types and methods to parse QR codes defined in the
[spec]. It supports parsing the QR format from an image or from a byte
string, converting back to an image and bytestring is possible as well.

[spec]: https://spec.matrix.org/unstable/client-server-api/#qr-code-format
2021-05-19 16:10:48 +02:00
Johannes Becker
eece920953 appservice: Initial version 2021-05-10 07:51:52 +02:00
Damir Jelić
4c6c1d2107 matrix-sdk: Get rid of the common macros crate
This crate was used to support different trait bounds on WASM vs other
targets, since we only define async traits in a couple of places having
a whole crate to support this feels a bit excessive.

This patch defines a target specific super trait instead, this lowers
the compile time a couple of seconds.
2021-01-04 16:34:14 +01:00
Damir Jelić
c4ed5b6cda matrix-sdk: Upgrade our deps. 2020-08-11 16:54:58 +02:00
Damir Jelić
cd5d5da06a matrix-sdk: Use the upstream git repo for olm-rs. 2020-08-10 13:43:18 +02:00
Damir Jelić
7c92d91c04 crypto: Use a patched olm-rs for now. 2020-07-22 11:39:30 +02:00
Damir Jelić
8a7c53c00d matrix-sdk: Remove the wrongly committed olm-sys/olm-rs patch defintions. 2020-07-11 22:18:01 +02:00
Damir Jelić
9bceb2f539 crypto: Add the user id and device id to the account. 2020-07-11 17:23:50 +02:00