Commit Graph

8755 Commits

Author SHA1 Message Date
Denis Kasak
11de0449fa Merge pull request from GHSA-9ggc-845v-gcgv
Avoid incorrect usage of private backup key
2024-05-13 10:07:10 +00:00
Ivan Enderlin
964553952d Merge pull request #3399 from matrix-org/stefan/invitesListCleanup
feat(ui): enable `room-list-with-unified-invites` by default, remove …
2024-05-13 11:51:10 +02:00
Ivan Enderlin
5c52014c4b Merge pull request #3386 from matrix-org/stefan/joinedRoomListFilter
feat(ui): add room list filter for excluding non-joined rooms
2024-05-13 11:24:13 +02:00
Stefan Ceriu
85d09c3c56 feat(ui): enable room-list-with-unified-invites by default, remove old invites sliding sync list. 2024-05-13 11:55:38 +03:00
Ivan Enderlin
c0924c87af feat(sdk): Introduce linked_chunk::Updates
feat(sdk): Introduce `linked_chunk::Updates`
2024-05-12 17:42:29 +02:00
Kévin Commaille
733665ddcc ui: Expose message mentions
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-11 10:53:52 +02:00
Andy Balaam
d5df58496b Merge pull request #3396 from zecakeh/ci-nightly
ci: Bump version of rust nightly
2024-05-10 16:27:14 +01:00
Valere
df5e8e724e Review: better comments
Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
Signed-off-by: Valere <bill.carson@valrsoft.com>
2024-05-10 15:49:20 +02:00
Valere
a7cc3777d1 Review: better comment
Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
Signed-off-by: Valere <bill.carson@valrsoft.com>
2024-05-10 15:49:02 +02:00
Kévin Commaille
4724115e8d chore: Fix docs warning
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-10 12:16:42 +02:00
Kévin Commaille
e355a6aa39 ci: Bump version of rust nightly
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-10 11:35:19 +02:00
Kévin Commaille
99ae06be68 chore: Fix cfg options
Cargo nightly now checks whether a cfg option exists.
We need to declare the custom
options we use
and fix those that are wrong.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-10 11:34:59 +02:00
Kévin Commaille
787b2d31cd chore: Fix warnings during compilation
cargo says that default_features will not be supported anymore in 2024 edition

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-05-10 11:32:05 +02:00
Doug
23f17614e5 ffi: Allow joining a room ID with server names. 2024-05-09 19:32:16 +02:00
Doug
eebbb74be7 ffi: Include servers when resolving a room alias.
Rename result.
2024-05-09 19:32:16 +02:00
Damir Jelić
fac5ba5bae chore(crypto): Refactor the PK signing subkey constructors
This makes the public key fields private to ensure that we don't
accidentally swap them out. It also moves the construction of the
subkeys into the master key type.
2024-05-09 18:03:55 +02:00
Damir Jelić
c57d2c68a1 fixup! chore(crypto): Refactor the cross-signing key wrappers 2024-05-09 17:41:32 +02:00
Damir Jelić
6b1ef484f2 chore(crypto): Refactor the cross-signing key wrappers
Since the master/self-signing/user-signing public key types are used for
public user identities as well as for the private key type we have, and
we'd like to sign the public key types it makes sense that the types
itself aren't using an Arc.

Let's instead put the Arc inside the user identity structs.

This will allow us later on to more easily sign the public key types.
2024-05-09 17:41:32 +02:00
Damir Jelić
aeb85ba836 chore: Add a better debug implementation for the backup recover/decryption key 2024-05-09 17:40:51 +02:00
Damir Jelić
afa3808752 chore: Use the released version of Ruma 2024-05-09 17:34:16 +02:00
Ivan Enderlin
1f26822a64 chore(sdk): Split linked_chunk into 2 modules. 2024-05-08 14:47:45 +02:00
Ivan Enderlin
44a78ba9f6 chore(sdk): Thanks Clippy. 2024-05-08 13:58:49 +02:00
Ivan Enderlin
1493dc2c6a chore(sdk): Remove the LinkedChunk prefix from type names. 2024-05-08 13:45:45 +02:00
Ivan Enderlin
9531a4041e feat(sdk): Allow LinkedChunkUpdatesInner to have multiple readers.
This patch removes the notion of `take` vs. `peek` from
`LinkedChunkUpdatesInner` and widens the problem to a more general
approach: `LinkedChunkUpdatesInner` must support multiple readers, not
only two (`take` was the first reader, `peek` was the second reader,
kind of).

Why do we need multiple readers? `LinkedChunkUpdates::take` is
clearly the first reader, it's part of the public API. But the private
API needs to read the updates too, without consuming them, like
`LinkedChunkUpdatesSubscriber`. `peek` was nice for that, but it's
possible to have multiple `LinkedChunkUpdatesSubscriber` at the same
time! Hence the need to widen the approach from 2 readers to many
readers.

This patch introduces a `ReaderToken` to identify readers. The last
indexes are now all stored in a `HashMap<ReaderToken, usize>`. The rest
of the modifications are the consequence of that.

The test `test_updates_take_and_peek` has been entirely rewritten to be
`test_updates_take_and_garbage_collector` where it tests 2 readers and
see how the garbage collector reacts to that.
2024-05-08 13:45:45 +02:00
Stefan Ceriu
1ce27d6eec feat(ui): add room list filter for excluding non-joined rooms 2024-05-08 12:48:14 +03:00
Ivan Enderlin
73ae1cc6da feat(sdk): Add LinkedChunkUpdatesSubscriber.
This patch implements `LinkedChunkUpdates::subscribe` and
`LinkedChunkUpdateSubscriber`, which itself implements `Stream`.

This patch splits `LinkedChunkUpdates` into `LinkedChunkUpdatesInner`,
so that the latter can be shared with `LinkedChunkUpdatesSubscriber`.
2024-05-08 09:23:20 +02:00
Michael Hollister
74b79d8212 ffi: Added dehydrated flag to Device
Signed-off-by: Michael Hollister <michael@futo.org>
2024-05-07 22:28:18 +02:00
Valere
d0776819c7 Review: Add assert error message
Co-authored-by: Damir Jelić <poljar@termina.org.uk>
Signed-off-by: Valere <bill.carson@valrsoft.com>
2024-05-07 14:43:15 +02:00
Valere
4e9edcb0db Review: better comment
Co-authored-by: Damir Jelić <poljar@termina.org.uk>
Signed-off-by: Valere <bill.carson@valrsoft.com>
2024-05-07 14:42:52 +02:00
Valere
e3dc094be4 Add minimal reproducing test 2024-05-07 10:20:19 +02:00
Valere
f4772c9b0e Add FIXME comment 2024-05-07 10:20:08 +02:00
Ivan Enderlin
76210686c4 feat(sdk): Implement Clone on LinkedChunkUpdate.
`LinkedChunkUpdate` implements `Clone` if and only if `Item` and `Gap`
both implement `Clone`.
2024-05-06 22:22:32 +02:00
Ivan Enderlin
3a00271af0 chore(sdk): Hmmmm. 2024-05-06 20:15:35 +02:00
Ivan Enderlin
d6915793c1 feat(sdk) Add the LinkedChunkUpdates::peek.
This patch adds the `LinkedChunkUpdates::peek` method. This is
a new channel to read the updates without consuming them, like
`LinkedChunkUpdates::take` does.

The complexity is: when do we clear/drop the updates then? We don't
want to keep them in memory forever. Initially `take` was clearing
the updates, but now that we can read them with `peek` too, who's
responsible to clear them? Enter `garbage_collect`. First off,
we already need to maintain 2 index, resp. `last_taken_index` and
`last_peeked_index` so that `take` and `peek` don't return already
returned updates. They respectively know the index of the last update
that has been read. We can use this information to know which updates
must be garbage collected: that's all updates below the two index.
Tadaa. Simple. The only _drawback_ (if it can be considered as such)
is that the garbage collection happens on the next call to `take` or
`peek` (because of the borrow checker). That's not really a big deal in
practise. We could make it happens immediately when calling `take` or
`peek` but it needs more pointer arithmetic and a less straighforward
code.
2024-05-06 20:13:42 +02:00
Damir Jelić
121dedee4e chore: Use a released version of vodozemac 2024-05-06 15:24:21 +02:00
Damir Jelić
8eebb9bb39 chore: Use a released version of uniffi (#3382)
The commit we were using has been part of the 0.27.1 release, so let's
use it:

789a9023b5
2024-05-06 14:32:47 +02:00
Ivan Enderlin
9e2e28d57a feat(sdk) Change the update history from a Vec<T> to a new LinkedChunkUpdates type.
This patch updates the `LinkedChunk::update_history` field from
a simple `Vec<LinkedChunkUpdate<Item, Gap>>` type to the new
`LinkedChunkUpdates<Item, Gap>` type (note the plural).

This is going to be helpul for the next patches.
2024-05-06 14:22:51 +02:00
Ivan Enderlin
2255cd5a43 chore(ffi): Remove support for opentelemetry
chore(ffi): Remove support for opentelemetry
2024-05-03 20:17:50 +02:00
Ivan Enderlin
12a231675c chore(ffi): Remove support for opentelemetry.
This patch removes support for OpenTelemetry because it's not used
anymore by anybody. It also adds multiple duplicated dependencies (like
`reqwest`). Anyway. Farewell.
2024-05-03 19:52:17 +02:00
Denis Kasak
60017241b2 Tweak log messages when rejecting devices (DeviceKeys structs) received from the server.
Preferring to use "reject" wording rather than "failed to
create/update". The latter can be easily misinterpreted as a failure of
the local client to create an entirely new device from scratch, rather
than refusal to instantiate a new local device representation of an
(invalid) device definition received from the server.
2024-05-03 14:08:36 +02:00
Denis Kasak
03fe9feb69 docs: Expand docs for the DeviceKeys struct. 2024-05-03 14:08:36 +02:00
Damir Jelić
6f2d8e0e50 chore: Fix some clippy warnings 2024-05-02 17:12:19 +02:00
Damir Jelić
56aa86da8b chore: Depend on a released version of mas-oidc-client 2024-05-02 17:12:19 +02:00
Ivan Enderlin
67e2842f84 feat(sdk): Introduce LinkedChunkUpdate
feat(sdk): Introduce `LinkedChunkUpdate`
2024-05-02 14:46:19 +02:00
Ivan Enderlin
443647a1ba feat(sdk): Make update history of LinkedChunk optional.
This patch makes the `LinkedChunk::update_history` field optional,
so that it doesn't require the user to drain it to avoid eating the
universe.

The `new` constructor disabled the update history, the
`new_with_update_history` enables it.
2024-05-02 14:30:19 +02:00
Ivan Enderlin
b9ea6ff300 chore(sdk): Rename LinkedChunkLinks to LinkedChunkEnds. 2024-05-02 14:30:19 +02:00
Ivan Enderlin
c219c727bb feat(sdk) Remove LinkedChunkListener.
This patch is a turn around about the `LinkedChunkListener`. Many
patches have been removed because `LinkedChunkListener` needed to
support I/O, so errors and async code. The whole code was affected by
that, resulting in a complex API. The idea of this patch is to decoupled
this. Here is how.

First off, `LinkedChunkListener` is removed. So it's one less generic
parameter on `LinkedChunk`. It's also one less trait, so less
implementations.

Second, now `LinkedChunk` accumulates/collects all “updates” under the
form of a new enum `LinkedChunkUpdate`. These updates can be read with
`LinkedChunk::updates(&mut self) -> &Vec<LinkedChunkUpdate>`. The reader
can simply read them, or even drain them. The reader is responsible
to handle these updates and to dispatch them in a storage or whatever.
`LinkedChunk` is no longer responsible to do that, removing the need to
support errors and to be async.

Third, the simplification has led to an optimisation by introducing a
new type `LinkedChunkLinks`. The documentation explains what it does
and why it was needed. The benefit of this type is: it doesn't increase
the size of `LinkedChunk`, but it simplifies the code: no more `Arc`,
no more `Mutex` (it was required because with I/O and async), no more
borrow checker trick, and the code stays as safe as before.
2024-05-02 14:30:19 +02:00
Ivan Enderlin
db0f9b19be feat(sdk) LinkedChunkError is a real error now. 2024-05-02 14:30:19 +02:00
Ivan Enderlin
343416653d feat(sdk): Create LinkedChunkListener.
This patch creates the `LinkedChunkListener` trait.

This patch also updates `LinkedChunk` to be able to use a
`LinkedChunkListener`.
2024-05-02 14:30:19 +02:00
Ivan Enderlin
17b3cb6b31 fix(store-encryption): Remove the displaydoc dependency
fix(store-encryption): Remove the `displaydoc` dependency
2024-05-02 09:41:43 +02:00