Commit Graph

10609 Commits

Author SHA1 Message Date
Damir Jelić
bb573117e1 chore: Release matrix-sdk version 0.9.0 matrix-sdk-ui-0.9.0 matrix-sdk-0.9.0 matrix-sdk-sqlite-0.9.0 matrix-sdk-indexeddb-0.9.0 matrix-sdk-base-0.9.0 matrix-sdk-store-encryption-0.9.0 matrix-sdk-crypto-0.9.0 matrix-sdk-qrcode-0.9.0 matrix-sdk-common-0.9.0 2024-12-18 15:12:23 +01:00
Andy Balaam
ff7077b742 doc(crypto): Add changelog entry for #4424 2024-12-18 13:51:00 +00:00
Ivan Enderlin
bb70229dd8 chore: Make Clippy happy. 2024-12-18 13:24:55 +01:00
Andy Balaam
03947618ff Merge branch 'release-for-crypto-wasm-11'
This brings in the fix for #4424 that we did on a release branch to
allow a quick release of crypto-wasm
2024-12-18 11:25:53 +00:00
Andy Balaam
b18e7d71ed fix(crypto): Fix error when reading VerifiedStateOrBool with old PreviouslyVerifiedButNoLonger value 2024-12-18 11:22:53 +00:00
Andy Balaam
612ba6fa29 task(crypto): Accept old PreviouslyVerified value of ShieldStateCode when deserializing 2024-12-18 11:22:53 +00:00
Andy Balaam
db39c6bea6 task(crypto): Accept old PreviouslyVerified value of VerificationLevel when deserializing 2024-12-18 11:22:53 +00:00
Andy Balaam
5f3b56a987 task(crypto): Accept old PreviouslyVerified value of SenderData when deserializing 2024-12-18 11:22:53 +00:00
Benjamin Bouvier
373709fb38 feat(event cache): don't replace a gap chunk by an empty items chunks 2024-12-17 18:30:57 +01:00
Benjamin Bouvier
5d8ad3a4a9 fix(linked chunk): in LinkedChunk::ritems_from, skip as long as we're on the right chunk
The previous code would skip based on the position's index, but not the
position's chunk. It could be that the position's chunk is different
from the first items chunk, as shown in the example, where the linked
chunk ends with a gap; in this case, the position's index would be 0,
while the first chunk found while iterating backwards had 3 items. As a
result, items 'd' and 'e' would be skipped incorrectly.

The fix is to take into account the chunk id when skipping over items.
2024-12-17 17:48:10 +01:00
Damir Jelić
0ca35d6c4a test: Test that room keys received by notification clients trigger redecryptions 2024-12-17 16:07:21 +01:00
Damir Jelić
daeffc07b3 feat: Derive PartialEq and Eq for RoomListLoadingState 2024-12-17 16:07:21 +01:00
Damir Jelić
bd15f4ecbe feat(timeline): Listen to the room keys stream to retry decryptions 2024-12-17 16:07:21 +01:00
Damir Jelić
f17f4e2bf6 feat: Add a stream to listen to room keys being inserted to the store 2024-12-17 16:07:21 +01:00
Damir Jelić
177ec1216f feat(crypto)!: Don't ignore the error if the room_keys_received stream lags 2024-12-17 16:07:21 +01:00
Valere
512a2d2662 Merge pull request #4399 from matrix-org/valere/ffi_save_store_dehydration_pickle_key
feat(crypto-ffi-bindings): Save/Load dehydrated pickle key
2024-12-17 10:07:54 +01:00
Valere
95582a6c3c feat(crypto-bindings): Save/Load dehydrated pickle key
review: better tests
2024-12-17 09:51:28 +01:00
Jorge Martín
866b5fea40 feat(room): Separate RoomState::Banned from RoomState::Left.
This is needed to tell apart rooms in left and banned state in places like `RoomInfo` or `RoomPreview`.

The banned rooms will still count as left rooms in the sync processes.
2024-12-16 19:19:56 +01:00
Benjamin Bouvier
34ea42aec0 feat(ffi): expose the linked chunk debug string function at the FFI layer 2024-12-16 16:41:03 +01:00
Benjamin Bouvier
cae7e43b91 feat(multiverse): add linked chunk debug screen in multiverse 2024-12-16 16:41:03 +01:00
Benjamin Bouvier
34d15a4d37 feat(event cache): propose a debug representation for the linked chunk in RoomEvents too 2024-12-16 16:41:03 +01:00
Benjamin Bouvier
f6cb8186c6 task(event cache): limit the display of event ids to 8 chars in the raw chunk debug string 2024-12-16 16:41:03 +01:00
dependabot[bot]
47044b1a23 chore(deps): bump crate-ci/typos from 1.28.2 to 1.28.3
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.28.2 to 1.28.3.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.28.2...v1.28.3)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 17:29:27 +02:00
Jorge Martín
05d46e6027 Rename JoinRequest in the SDK crates to KnockRequest, make Room::mark_knock_requests_as_seen thread safe and pass user_ids instead of event_ids: the user ids will be used to get the related member state events and they'll only be marked as seen if they're in a knock state.
Also, add extra checks to the integration tests.
2024-12-16 14:08:09 +01:00
Jorge Martín
338769508e feat(ffi): add bindings for subscribing to the join requests 2024-12-16 14:08:09 +01:00
Jorge Martín
93ebae6601 feat(room): allow subscribing to requests to join a room
This subscription will combine 3 streams: one notifying the members in the room have changed, another notifying the seen join requests have changed, and finally a third one notifying when the room members are no longer synced.

With this info we can track when we need to generate a new list of join requests to be emitted so the client can always have an up to date list.
2024-12-16 14:08:09 +01:00
Jorge Martín
780c264e59 feat(room): add JoinRequest abstraction
This struct is an abstraction over a room member or state event with knock membership.
2024-12-16 14:08:09 +01:00
Jorge Martín
9a899c1cb1 feat(room): add 'seen request to join ids' to the stores
This will allow us to keep track of which join room requests are marked as 'seen' by the current user and return them as such.

Also, add some methods to `Room` to mark new join requests as seen and to get the current ids for the seen join requests.
2024-12-16 14:08:09 +01:00
Richard van der Hoff
2703f7f7d4 crypto: extra logging in OtherUserIdentity
Add some extra logging in these two methids, to try to narrow down a bug report
we received.
2024-12-16 12:59:16 +00:00
Kévin Commaille
8d2e672996 feat!: Upgrade Ruma to 0.12.0
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-12-16 11:56:44 +01:00
Benjamin Bouvier
5a25e65da3 test(event cache): use the MatrixMockServer 2024-12-16 11:56:22 +01:00
Benjamin Bouvier
c197808b42 task(event cache): get rid of one level of indent 2024-12-16 11:56:22 +01:00
Benjamin Bouvier
ed34719295 task(event cache): simplify handling a back-pagination result 2024-12-16 11:56:22 +01:00
Benjamin Bouvier
a052a79aaf fix(event cache): store the gap *before* events, after back-paginating
The conditions required to cause the bug might have been impossible to
reach in the real world, because it assumes a mix of:

- events present in the linked chunk
- no prev-batch token

However: now that we have storage, we could end up in this situation,
when reaching the start of the timeline (since there'll be no previous
gap in that case). We need to handle that better in the linked chunk
representation itself, but in the meanwhile, we should insert the gap
and the events in a relative correct order.
2024-12-16 11:56:22 +01:00
Benjamin Bouvier
b6542477bb task(event cache): make the code more concise in back-pagination 2024-12-16 11:56:22 +01:00
Kévin Commaille
a573b650c9 chore(sdk): Remove image-rayon cargo feature check from build.rs
The cargo feature was removed, but the build script was forgotten.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-12-15 18:07:42 +01:00
Valere
789bd317b3 Merge pull request #4383 from matrix-org/valere/cache_dehydration_pickle_key
feat(crypto): Support storing the dehydrated device pickle key
2024-12-13 14:42:44 +01:00
Valere
2b39476d9b feat(crypto): Support storing the dehydrated device pickle key 2024-12-13 13:05:19 +01:00
Andy Balaam
6dcefe49c2 feat(utds): Provide the reason why an event was an expected UTD 2024-12-13 10:46:10 +00:00
Benjamin Bouvier
150d9e4b05 fix(event cache store): always use immediate mode when handling linked chunk updates
If a linked chunk update starts with a RemoveChunk update, then the
transaction may start with a SELECT query and be considered a read
transaction. Soon enough, it will be upgraded into a write transaction,
because of the next UPDATE/DELETE operations that happen thereafter. If
there's another write transaction already happening, this may result in
a SQLITE_BUSY error, according to
https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions

One solution is to always start the transaction in immediate mode. This
may also fail with SQLITE_BUSY according to the documentation, but it's
unclear whether it will happen in general, since we're using WAL mode
too. Let's try it out.
2024-12-12 17:59:42 +01:00
Damir Jelić
54bd1d7931 refactor(base): Move the joined member count logic into its respective sub-functions 2024-12-12 14:44:21 +01:00
Damir Jelić
7ae31d0cb1 fix(base): Subtract the number of service members from the number joined members
This patch fixes an edge case where the member is alone in the room with
a service member. We already subtracted the number of service members
in the case we calculated the room summary ourselves, but we did not do
so when the server provided the room summary.

This lead to the room, instead of being called `Empty`, being called
`Foo and N others`.
2024-12-12 14:44:21 +01:00
Damir Jelić
f7f58dfd71 feat(ui): Add the MemberHints state event type to the required state
This state event allows us to correctly calculate the room display name
according to MSC4171.

MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4171
2024-12-12 14:44:21 +01:00
Richard van der Hoff
780a4630e4 chore(ffi): avoid hardcoding clang version
Update the workaround for https://github.com/rust-lang/rust/issues/109717 to
avoid hardcoding the clang version; instead, run `clang -dumpversion` to figure
it out.

While we're there, use the `CC_x86_64-linux-android` env var, which should
point to clang, rather than relying on `ANDROID_NDK_HOME` to be set.
2024-12-12 12:54:00 +00:00
Benjamin Bouvier
3356e0cc82 refactor(state store): use a single lock for all memory store accesses
The `MemoryStore` implementation of the `StateStore` has grown into a
monster, with one lock per field. It's probably overkill, as individual
fields don't need fine-grained locks like this; after all, accesses to
the store shouldn't be reentrant in general.

Fixes #3720.
2024-12-12 10:04:09 +01:00
Richard van der Hoff
fda374ee81 feat(ffi): Add new properties to UnableToDecryptInfo
Followup to https://github.com/matrix-org/matrix-rust-sdk/pull/4360: expose
the new properties via FFI
2024-12-11 18:42:28 +00:00
Benjamin Bouvier
0264e49968 task(event cache): rename a few things
- rename RawLinkedChunk -> RawChunk
- rename RawChunk::id -> RawChunk::identifier
- precise that a `RawChunk` is mostly a `Chunk` with different
previous/next links.
2024-12-11 12:10:24 +01:00
Benjamin Bouvier
d42c449612 refactor(event cache): only store a prev-batch token if the timeline was limited 2024-12-11 12:10:24 +01:00
Benjamin Bouvier
925d10f2ff task(event cache store): include the number of added items in one log 2024-12-11 12:10:24 +01:00
Benjamin Bouvier
4402f59e74 refactor(event cache): spawn a task to handle updates to the event cache store 2024-12-11 12:10:24 +01:00