Commit Graph

14300 Commits

Author SHA1 Message Date
Benjamin Bouvier
9d7c21f508 refactor(timeline): make it possible to pass an EmbeddedEvent to maybe_update_responses 2025-10-14 15:37:04 +02:00
Benjamin Bouvier
3705b73256 feat(event cache): when a thread has only redacted replies, remove the thread summary 2025-10-14 15:37:04 +02:00
Benjamin Bouvier
3fb874f901 fix(event cache): also update the thread summary when the redacted event is not the latest one 2025-10-14 15:37:04 +02:00
Benjamin Bouvier
215087f2c1 feat(event cache): have redaction affect thread chunks and summaries
In this initial version, a redaction will:

- *remove* the event from the thread chunk, as does Element Web,
- update the thread summary to reflect the new number of messages in the
  thread, and let us have a thread summary with 0 replies.

A next commit will adapt the code so that a thread summary with 0
replies is removed.
2025-10-14 15:37:04 +02:00
Kévin Commaille
1e2bf39a7c Update Ruma
Brings changes to the requests metadata. It was changed from a struct to a trait, and the authentication scheme is now an associated type.

This allows to forbid at compile time requests that use an unsupported authentication scheme.
2025-10-14 15:32:32 +02:00
vaw
c1bc814ac2 feat(timeline): Use read receipt as fallback for read marker
Signed-off-by: vaw <git@nlih.de>
2025-10-14 09:07:50 +01:00
Richard van der Hoff
7185fcbac8 Merge pull request #5763 from matrix-org/rav/history_sharing_exclude_insecure_devices
crypto: Fix bugs in processing incoming encrypted to-device messages
2025-10-13 17:02:14 +01:00
Richard van der Hoff
01e2e4877c test(crypto): Regresion test for #5613
Add a test to ensure that history-sharing still works when "exclude insecure
devices" is enabled.
2025-10-13 16:41:56 +01:00
Richard van der Hoff
3622355a08 test(crypto): add regression test for #5768 2025-10-13 16:41:56 +01:00
Richard van der Hoff
c388332e47 crypto: fall back to sender_device_keys for encrypted to-device messages
When receiving an encrypted to-device message, if the sender device is not in
the store, but the event includes `sender_device_keys`, use
`sender_device_keys` to do the verification checks etc.

Fixes: https://github.com/matrix-org/matrix-rust-sdk/issues/5768
2025-10-13 16:41:56 +01:00
dependabot[bot]
6042a9e9b0 chore(deps): bump crate-ci/typos from 1.37.2 to 1.38.1
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.37.2 to 1.38.1.
- [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.37.2...v1.38.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 17:07:56 +02:00
dependabot[bot]
04260458ef chore(deps): bump qmaru/wasm-pack-action from 0.5.1 to 0.5.2
Bumps [qmaru/wasm-pack-action](https://github.com/qmaru/wasm-pack-action) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/qmaru/wasm-pack-action/releases)
- [Commits](https://github.com/qmaru/wasm-pack-action/compare/v0.5.1...v0.5.2)

---
updated-dependencies:
- dependency-name: qmaru/wasm-pack-action
  dependency-version: 0.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 17:04:11 +02:00
Benjamin Bouvier
7c3a8b335a doc(timeline): tweak wording of TimelineBuilder::with_focus
It was incorrect to say that the timeline focus can be changed after the
timeline has been created, since it is *not* the case. Also explained
what the default value is.
2025-10-13 16:42:45 +02:00
Kévin Commaille
a8aa8761d8 Add changelog for waveform changes
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-13 14:10:14 +02:00
Kévin Commaille
bfc96181dd refactor(sdk): Change waveform to be a list of values between 0 and 1
Most clients will probably work with values between 0 and 1 and need to
convert it just to send it, so we can move that conversion into the SDK.

This is also more forwards-compatible, because MSC3246 now has a
different max value for the amplitude, so when this becomes stable, the
only change needed will be in the SDK.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-13 14:10:14 +02:00
Kévin Commaille
eb1ee434b3 refactor(sdk): Allow to send waveform for any audio message
By moving the waveform declaration into `BaseAudioInfo`.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-13 14:10:14 +02:00
Richard van der Hoff
e7fa8a429a test(crypto): simplify send_and_receive_encrypted_to_device_test_helper
No need to convert the event content to a to-device request, and then convert
back again.
2025-10-10 15:47:10 +01:00
Richard van der Hoff
8b6572bb23 test(crypto): Factor out test helper for encrypting to-device content
I'm going to need to suppress `sender_device_keys` for more tests, so pull out
a test helper to help with this.
2025-10-10 15:47:10 +01:00
Richard van der Hoff
43e94bcfb4 crypto: look up sender device for key bundles
Currently, when we receive a room key bundle to-device event, we don't look up
the sender device at all, meaning that the message is then marked as "from
missing device", which means that if you turn on "exclude insecure devices",
the message is dropped.

This patch changes the logic so that room key bundle to-device events are
treated the same way as most other to-device events (except room keys, which
continue to be special).

Fixes: https://github.com/matrix-org/matrix-rust-sdk/issues/5613, although the
integration test now fails because instead we hit https://github.com/matrix-org/matrix-rust-sdk/issues/5768.
2025-10-10 15:47:10 +01:00
Michael Goldenberg
588d604653 refactor(indexeddb): remove extraneous log message
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
90cf669f94 refactor(indexeddb): import transaction mode from indexed_db_futures rather than web_sys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
70a608b3b5 refactor(indexeddb): remove nested memory store from MediaStore impl
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
bcd4337985 test(indexeddb): add integration tests for MediaStoreInner
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
58972ca9d9 fix(indexeddb): ensure media that ignore retention policy is always put into IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
ef672271c2 fix(indexeddb): ensure tx is committed in MediaStore::set_media_retention_policy_inner
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
1bc417956c feat(indexeddb): add IndexedDB-backed impl for MediaStoreInner::set_ignore_media_retention_policy_inner
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
1127184db2 refactor(indexeddb): add transaction fn for putting media into IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
63a3c2d51a refactor(indexeddb): remove base64 encoding of unencrypted media content
This makes unencrypted content sizes consistent and testable.

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
3f55c217c1 feat(indexeddb): add IndexedDB-backed impl for MediaStoreInner::clean_inner
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
19632683f7 refactor(indexeddb): make getters for media content size key consistent with those for other media keys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
03f964a5a3 refactor(indexeddb): add fns to get field components of indexed media keys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
752beadb83 fix(indexeddb): add associated index to IndexedKey<Media> where missing
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
6244721ab4 refactor(indexeddb): add transaction fns for deleting media by content size and access time
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
6e034b0d7b refactor(indexeddb): add transaction fn for getting the size of the media cache
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
e4a717dff5 refactor(indexeddb): add media-specific transaction fns for getting and operating on keys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
6acf628fc5 refactor(indexeddb): import cursor direction enum from indexed_db_futures rather than web_sys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
db91bb35ee refactor(indexeddb): add transaction fns for getting and operating on keys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
3b7dbf5c04 feat(indexeddb): add IndexedDB-backed impl for MediaStoreInner::last_media_cleanup_time_inner
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
22bfe8fbd3 refactor(indexeddb): add fns to get and put media cleanup time
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
e4243b7af3 refactor(indexeddb): add indexed type and traits for media cleanup time
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
f891c1ca06 refactor(indexeddb): add type for representing media cleanup time
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Michael Goldenberg
c2839d7594 refactor(indexeddb): add conversions and operations for UnixTime
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-10 10:09:52 +02:00
Richard van der Hoff
c45ede972e crypto: factor out Account::get_event_sender_device
`Account::parse_decrypted_to_device_event` is getting a bit big and unwieldy,
so factor out the bit that attempts to find the sending device.

(Also, remove an outdated TODO.)
2025-10-09 18:26:46 +01:00
Johannes Marbach
9b485013e1 feat(ffi): add bindings for listening to room send queue updates
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-10-09 15:18:04 +01:00
Kévin Commaille
cb3d281f8f Upgrade Ruma after removal of legacy mention push rules
The legacy mention push rules were removed, and the
`contains_display_name` condition was deprecated.

Some tests check for backwards-compatibility with legacy mentions, so we
need to add them back for those tests.

A test with an encrypted event was relying on the legacy mentions, so
the encrypted event was replaced with another one with an intentional
mention.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Kévin Commaille
a72c19a240 test(ui): Allow to set own user id of TestRoomDataProvider
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Kévin Commaille
cf4a1dee4b Upgrade Ruma after StringEnum changes
StringEnum now also implements Ord, PartialOrd, Eq and PartialEq so it
is not necessary to derive them. Also the ordering used is comparing the
string representation of the variants.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Kévin Commaille
487470be8f Upgrade Ruma after extended profile field stabilization
Extended profile fields were stabilized so the old endpoints are now
deprecated, and there are a few other changes.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Richard van der Hoff
b94823216d Merge pull request #5766 from matrix-org/rav/device_keys_self_signature
crypto: give `DeviceKeys` ability to check their own signature
2025-10-09 12:26:41 +01:00
Richard van der Hoff
232119cf57 crypto: avoid redundant conversion to DeviceData
There is (now) no need to turn the `sender_device_keys` into a `DeviceData`.
2025-10-09 11:32:09 +01:00