Commit Graph

14405 Commits

Author SHA1 Message Date
Johannes Marbach
70665a84aa feat(client): make it possible to subscribe to key upload errors (#6135)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-02-11 14:11:51 +01:00
Joe Groocock
c6b58b0e2b feat: Expose MSC4171 service members
Signed-off-by: Joe Groocock <me@frebib.net>
2026-02-11 12:49:46 +00:00
Benjamin Bouvier
ce0bba5e6d test: make more use of the EventFactory for the room topic
And get rid of test events. This implied adding a way to provide the
previous content of a state event, in the event factory.
2026-02-11 09:48:46 +01:00
Ivan Enderlin
87787dc04e refactor(sdk): Re-implement PinnedEventCacheStateLock with StateLock. 2026-02-11 08:23:51 +01:00
Ivan Enderlin
a12f659653 refactor(sdk): Re-implement RoomEventCacheStateLock with StateLock. 2026-02-11 08:23:51 +01:00
Ivan Enderlin
f4da1fa582 feat(sdk): Introduce the StateLock type in EventCache.
This patch introduces the `StateLock` type. It's a copy of the
`RoomEventCacheStateLock` logic, but generalised to any state `S`.
2026-02-11 08:23:51 +01:00
Benjamin Bouvier
7fbb2ddae1 test: add a new method for the state pinned events in the event factory 2026-02-10 18:41:15 +01:00
dependabot[bot]
1e0c930a12 chore(deps): bump bnjbvr/cargo-machete
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete) from 78beac95c8fd7c25bdfb194415128523e41512d5 to 3026399e8ccbe119a9624e9376afc8c5f21fb60f.
- [Release notes](https://github.com/bnjbvr/cargo-machete/releases)
- [Changelog](https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md)
- [Commits](78beac95c8...3026399e8c)

---
updated-dependencies:
- dependency-name: bnjbvr/cargo-machete
  dependency-version: 3026399e8ccbe119a9624e9376afc8c5f21fb60f
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 15:50:41 +01:00
Kevin Boos
0715da0626 Enable ruma's compat-unset-avatar feature
Without this, the `Account::set_avatar_url()` function does not work
on homeservers that don't advertise support for the new endpoints
for setting profile fields.
2026-02-10 13:39:25 +01:00
dependabot[bot]
b1d878ddc2 chore(deps): bump crate-ci/typos from 1.43.0 to 1.43.4
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.43.0 to 1.43.4.
- [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.43.0...v1.43.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 13:37:59 +01:00
Ivan Enderlin
13b07c3ece feat(xtask): Always open leaf nodes.
This patch adds the `open` attribute to the `<details>` for displaying
leaf nodes of the tree. My experience shows that it's nice to always
have them open. The “occurences” list is still folded, so it shouldn't
take to much space on the screen most of the time (one line per level of
logs in this node).
2026-02-10 13:33:48 +01:00
Ivan Enderlin
00e58056a4 fix(xtask): Remove a bad calculation to timeout bar. 2026-02-10 13:33:48 +01:00
Ivan Enderlin
e1e86a78c9 feat(xtask): Add log overview.
This patch adds the `log overview` task that generates a standalone HTML
report representing the logs as a tree where each node is a target, and
each leaf is a log location with occurrences, spans and fields.

Each node displays the sum of errors and warnings for this node.
It helps to quickly spot the problematic targets, and it guides to
exploration of the node without taking the reader's hand by trying to
draw conclusions. We don't want to guide the reader to a mistake: we
just want to guide the reader to draw its own conclusions.

Each line can be highlighted. When a node is folded/closed, it is also
highlighted if at least one of its child is highlighted.

The occurrences of logs are displayed on a timeline.
2026-02-10 13:33:48 +01:00
Doug
f1e41222f8 fix: Fix a deserialisation failure when the avatar_url is null. matrix-sdk-ffi/20260210 2026-02-10 11:32:52 +01:00
Ivan Enderlin
df6fc21576 refactor(sdk): Remove assume_has_waited_for_initial_prev_token.
This patch removes the `assume_has_waited_for_initial_prev_token` by
making `waited_for_initial_prev_token` to return a `&mut bool` instead
of `bool`.
2026-02-10 11:25:41 +01:00
Ivan Enderlin
72c1a655f2 refactor(sdk): waited_for_initial_prev_token is no more an Arc<AtomicBool>.
This patch changes `RoomEventCacheState::waited_for_initial_prev_token`
from `Arc<AtomicBool>` to `bool`. First off, the `Arc` wasn't used in
any useful way (never cloned for example). Second, the `AtomicBool` was
always used as a regular bool, no atomicity was really used. Lastly,
this patch adds the `assume_has_waited_for_initial_prev_token` method to
replace the `= true` operation to make code a bit more readable.
2026-02-10 11:25:41 +01:00
dependabot[bot]
ae36751c9d chore(deps): bump CodSpeedHQ/action from 4.10.4 to 4.10.6
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 4.10.4 to 4.10.6.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](fa0c9b1770...4deb3275dd)

---
updated-dependencies:
- dependency-name: CodSpeedHQ/action
  dependency-version: 4.10.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 11:15:25 +01:00
Ivan Enderlin
b1c4e45657 refactor(sdk): RoomEventCache::subscribe_to_pinned_events no longer takes a write lock.
This patch removes the write lock acquisition in
`RoomEventCache::subscribe_to_pinned_events` to replace it by read lock
acquisition. Nothing requires a `&mut self` at any point in this flow,
since `OnceLock::get_or_init` needs a `&self`.

The `RoomEventCacheStateLockWriteGuard::subscribe_to_pinned_events`
method is moved onto `RoomEventCacheStateLockReadGuard`.
2026-02-10 10:14:49 +01:00
Ivan Enderlin
f0ee76c27f refactor(sdk): Remove one Vec allocation.
`LinkedChunk::push_items_back` expects an `IntoIter<Item = Event>`.
`EventLinkedChunk::push_live_events` has an `events` of kind `&[Event]`.
Using `events.iter().cloned()` instead of `events.to_vec()` not only
removes one `Vec` allocation, but it allows the compiler to apply more
optimisation.

Checking on godbolt.org, I see twice fewer LLVM IR lines, and 2.8x times
less ASM code.
2026-02-10 09:34:08 +01:00
Ivan Enderlin
c1c48c2309 doc(sdk): Fix a typo for subscribe_to_pinned_events. 2026-02-10 08:36:31 +01:00
Ivan Enderlin
b2fb7ad4e9 doc(sdk): Add #6143 to the CHANGELOG.md file. 2026-02-09 16:10:43 +01:00
Ivan Enderlin
6e20fb60fb fix(sdk): Restrict when m.room.member represents a LatestEvent candidate.
This patch relies on `MembershipChange` to decide when a `m.room.member`
represents a `LatestEvent` candidate. It was a mistale to rely on the
`membership` strictly, because the `prev_content` must be taken into
account.

Thus, this patch adds the following cases to `Knocked`, `Joined` and
`Invited`: `InvitationAccepted` and `KnockedAccepted`. Moreover, this
patch excludes other cases, including `ProfileChanged`, which was a bug
previously! When the user had a new display name, it was considered as a
`LatestEvent` candidate.
2026-02-09 16:10:43 +01:00
Benjamin Bouvier
bc3ea6854b doc(event cache): explicit why we're stripping bundled relations from events before storing them in the event cache 2026-02-09 15:50:59 +01:00
Benjamin Bouvier
0ca9a0e6d1 refactor(event cache): extract send_updates_to_store as a common helper function 2026-02-09 15:50:59 +01:00
Benjamin Bouvier
cc852c661f refactor(event cache): introduce persistence utils for the event cache
A bit of code has been duplicated for implementing the pinned events
linked chunk. This new module starts to common out a bit of it.
2026-02-09 15:50:59 +01:00
Ivan Enderlin
37c85fc774 chore(sdk): Downgrade a log from info to trace.
This patch changes an `info!` log to a `trace!`. Latest Events are
pretty stable now, and we don't get an info for each new computation
except when we want a proper trace.
2026-02-09 13:53:37 +01:00
Ivan Enderlin
6ef549e29a chore(sdk): Downgrade a log from error to info.
This patch changes an `error!` log to a `info!`. Indeed, this is not an
error to compute a Latest Event that doesn't exist yet. The system is
lazy purposely.
2026-02-09 13:53:37 +01:00
Doug
b288ecbd25 Spaces: Check the power levels before removing an m.space.parent event. (#6132)
Small bug fix that makes `remove_child_from_parent` behave like
`add_child_to_parent`.

Additionally introduces a new Error case so that clients can decide to
ignore any failures updating the child → parent relationship.
2026-02-09 13:48:11 +02:00
Damir Jelić
de3c5550a5 refactor(qr-login): Use the proper casing for an enum variant 2026-02-09 11:13:58 +01:00
Damir Jelić
8f04a48d1e refactor(qr-login): Remove the rendezvous_url method
MSC4388 doesn't use the full rendezvous URL in the QR code, instead we
just get the rendezvous ID.
2026-02-09 11:13:58 +01:00
Lakshya Nayak
f787511616 fix(sliding-sync): re-dispatch invited/knocked rooms after reinvite (#6126)
## Problem

When a room goes through:

join -> leave/kick -> re-invite
Sliding Sync responses still include the room, but the SDK does not emit
an
Invited/Knocked update. Because of this, RoomListService is never
notified and
the room disappears from the room list until the application restarts.

## Root cause
"update_any_room()" only returned a RoomUpdateKind when one was
explicitly
produced. For re-invites it could return "None", causing the room to be
skipped.

## Fix
Always emit a default:
- "RoomUpdateKind::Invited"
- "RoomUpdateKind::Knocked"
when the room state is Invited/Knocked but no update kind was generated.

## Tests
Added a regression test covering:
join -> leave -> re-invite to ensure the room is surfaced again in the
invited list.

---------

Signed-off-by: Lakshya Nayak <89520692+VEL0C1TY22@users.noreply.github.com>
2026-02-09 10:44:59 +02:00
Damir Jelić
ea58bc8139 Update ruma 2026-02-06 15:36:17 +01:00
dependabot[bot]
872bb095b6 chore(deps): bump time from 0.3.44 to 0.3.47
Bumps [time](https://github.com/time-rs/time) from 0.3.44 to 0.3.47.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.3.44...v0.3.47)

---
updated-dependencies:
- dependency-name: time
  dependency-version: 0.3.47
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 10:12:37 +00:00
Ivan Enderlin
bff5c2f0e1 doc(base): Add #6130 to CHANGELOG.md. 2026-02-06 11:09:28 +01:00
Ivan Enderlin
627fe82ef3 test(base): Ensure that each state store has its own channel for RoomInfoNotableUpdates. 2026-02-06 11:09:28 +01:00
Ivan Enderlin
70faf2c3f3 fix(base): Move BaseClient::room_info_notable_update_sender into BaseStateStore.
This patch fixes a design issue. The
`BaseClient::room_info_notable_update_sender` is moved inside
`BaseStateStore` so that, when creating a new `BaseStateStore`, the
updates are not shared with other state stores. Updates are isolated to
the state store.

This bug has surfaced in `BaseClient::clone_with_in_memory_state_store`,
where a new `BaseStateStore` is created, but the
`room_info_notable_update_sender` was _cloned_, and that is a bug! We
could have re-created a new channel from scratch, but it would have
been hacky. Semantically, this channel should be part of the state store
itself. One proof is how it simplifies many call-sites, functions,
methods and structs: the `room_info_notable_update_sender` was passed
to multiple methods on `BaseStateStore`.
2026-02-06 11:09:28 +01:00
Jonas Richard Richter
0ec3db59f8 chore: move change to top of changelog 2026-02-06 09:38:50 +01:00
Jonas Richard Richter
caa75981bb chore: add PR link to CHANGELOG.md 2026-02-06 09:38:50 +01:00
Jonas Richard Richter
c49df20cd3 feat(ffi): include raw JSON of the underlying event in NotificationItem 2026-02-06 09:38:50 +01:00
Damir Jelić
036c5d35cd feat(crypto): Add a constructor for the MSC4388 variant of the QRCodeData struct 2026-02-05 21:17:44 +01:00
Benjamin Bouvier
80920e9ff2 refactor(common): use ruma's RelationType in the extractor functions 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
071f982eed fix(event cache): don't include thread responses in the pinned event cache
There were two issues:

- first, `load_or_fetch_event_with_relations()` allowed to pass a
filter, but the filter wasn't taken into account when fetching relations
from the network. This would cause the initial load of pinned events to
also include thread responses, which we don't want.
- similarly, when adding related events from sync, we'd only look if an
event had a `m.relates_to` field; but it could be a thread response
being added in live.

The two issues are fixed similarly, by using a new `extract_relation`
serde helper that gives both the related_to event and the relation type.
That way, we can apply a manual filter in
`load_or_fetch_event_with_relations` after fetching relations from
network, and we can filter out live events based on the relation type.
2026-02-05 16:43:25 +01:00
Benjamin Bouvier
4aff3b566f refactor(event cache): use the background job monitoring for the pinned events task 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
eb8bd2d0b1 refactor(event cache): address review comments from 6085 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
59fd7530f9 test(event cache): declare victory \o/ 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
5778685352 feat(event cache): reload the pinned event cache at startup \o/ 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
d3742d2b30 feat(event cache): add support for redecryption in the pinned event cache 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
fcf0b87489 chore: address typos and cosmetic changes in an integration test 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
d7ecbc3c83 refactor(event cache): use the Room::load_or_fetch_events_with_relations now that it's widely available 2026-02-05 16:43:25 +01:00
Benjamin Bouvier
f2279cd737 refactor(timeline): move load_event_with_relations to the RoomDataProvider trait
And get rid of the `PinnedEventsRoom` trait, and the accompanying file.
2026-02-05 16:43:25 +01:00