Commit Graph

10839 Commits

Author SHA1 Message Date
Damir Jelić
4344e06707 refactor(ui): Rename the scheduler task to supervisor task
From cambridge a scheduler is defined as:
    > someone whose job is to create or work with schedules

While supervisor is defined as:
    > a person whose job is to supervise someone or something

Well ok, that doesn't tell us much, supervise is defined as:
    > to watch a person or activity to make certain that everything is done correctly, safely, etc.:

In conclusion, supervising a task is the more common and better
understood terminology here I would say.
2025-01-28 12:48:55 +01:00
Damir Jelić
173ec75bb3 refactor(ui): Move common data of the SyncService under a lock
Previously we had a lock protecting an empty value, but the logic wants
to protect a bunch of data in the SyncService.

Let's do the usual thing and create a SyncServiceInner which holds the
data and protect that with a lock.
2025-01-28 12:48:55 +01:00
Ivan Enderlin
1d3f8bf898 doc(ui): Update the CHANGELOG. 2025-01-28 09:54:31 +01:00
Ivan Enderlin
5b3b87d3e2 chore(ui): Rename Timeline::subscribe_batched to ::subscribe.
This patch renames `Timeline::subscribe_batched` to
`Timeline::subscribe`. Since the `Timeline::subscribe` method has been
removed because unused, it no longer makes sense to have a “batched”
variant here. Let's simplify things!
2025-01-28 09:54:31 +01:00
Ivan Enderlin
6dc5b33d87 chore(ui): Remove useless trace!.
This patch removes useless `trace!` calls.
2025-01-28 09:54:31 +01:00
Richard van der Hoff
408b843156 test: fix cross-signing in legacy dehydrated device test
We missed a call to `sign_device_keys`. Pull out a test helper to make it more
obvious where this code is coming from.
2025-01-27 17:49:47 +00:00
Ivan Enderlin
0820170261 doc(ui): Update the CHANGELOG. 2025-01-27 17:02:09 +01:00
Ivan Enderlin
254ac6f2ce refactor(ui): Unify the Timeline pagination API.
This patch simplifies the `Timeline` pagination API as follows:

- a unique `paginate_backwards` method (no more
  `focused_paginate_backwards` and `live_paginate_backwards`),
- a unique `paginate_forwards` method (no more
  `focused_paginate_forwards`, the `live` variant was absent).

The idea is to unify pagination by hiding the `live` and `focused` mode.
It was already partially the case with `paginate_backards`, but the
`live` and `focused` variants were also present. I believe it creates
an unnecessary confusion.
2025-01-27 17:02:09 +01:00
Ivan Enderlin
468a7ac883 doc(ffi): Remove useless #[cfg(doc)] imports.
This patch removes 2 useless imports that are behind a `#[cfg(doc)]` but
never used.
2025-01-27 17:02:09 +01:00
Richard van der Hoff
3e610c80e1 Merge pull request #4581 from matrix-org/rav/refactor_share_keys
crypto: refactor the room key sharing strategies
2025-01-27 15:51:04 +00:00
Richard van der Hoff
f43edbd31f refactor(crypto): split up split_devices_for_user_for_error_on_verified_user_problem_strategy
to make it easier to grok, I hope
2025-01-27 15:34:43 +00:00
Richard van der Hoff
7c57f2cee4 crypto: split out new device collection strategies
Rather than a bunch of flags on `DeviceBasedStrategy`, separate the strategies
properly.
2025-01-27 15:34:43 +00:00
Richard van der Hoff
8d612eca46 crypto: break up split_devices_for_user
handle the separate flags with separate methods.
2025-01-27 15:34:43 +00:00
Richard van der Hoff
98f4d55aa0 test: check serialization format of DeviceBasedStrategy 2025-01-27 15:34:43 +00:00
Richard van der Hoff
709b09c4ec test: factor out test helpers in share_strategy tests
Some helpers for creating common `EncryptionSettings`
2025-01-27 15:34:43 +00:00
Richard van der Hoff
818876a22e crypto: factor out common code between device collection cases
Firstly, build a `CollectRecipientsResult` as we go, rather than building its
components separately and then assembling it at the end.

Then, factor the common code between the two code paths into a method to update
the `CollectRecipientsResult`.
2025-01-27 15:34:43 +00:00
Stefan Ceriu
2657eb7866 feat(ui): expose a method for checking whether a message contains only emojis and should be boosted (use a bigger font size) (#4577)
- supports only text room message types
- enumerates through their body's grapheme clusters and check that every
single one of them is an emoji
- part of the `LazyTimelineItemProvider` so that it can be opt in
2025-01-27 14:00:01 +00:00
torrybr
aaecbf07f2 refactor: dont panic if beacon_info is not found 2025-01-27 11:05:24 +01:00
torrybr
f336638a17 refactor: move subscribe into arc 2025-01-27 11:05:24 +01:00
torrybr
839fbe477c feat(beacons): expose ffi functions to start, stop and subscribe 2025-01-27 11:05:24 +01:00
Richard van der Hoff
35ad5441d3 crypto: split common struct out of device collection results
`split_devices_for_user` returns a superset of the results of
`split_recipients_withhelds_for_user_based_on_identity`: let's reflect that in
the return types so we can start to share code.

Also, rename `split_recipients_withhelds_for_user_based_on_identity` to
`split_devices_for_user_for_identity_based_strategy` while we are here.
2025-01-26 22:50:15 +00:00
Kevin Boos
756dec264d Upgrade imbl, eyeball-im, eyeball-im-util to fix bounds check
A bounds check was recently relaxed in `imbl`'s `Focus::narrow()`
function: https://github.com/jneem/imbl/pull/89,
which fixed a bug that would cause a panic if the downstream user
of `matrix-sdk-ui` attempted to narrow a focus of Timeline items
using a range that included the last item in the Timeline.
Example: https://github.com/project-robius/robrix/issues/330

This fix has been incorporated in `eyeball-im` and `eyeball-im-util`
and has been tested by me to no longer trigger upon the aforementioned
conditions.
2025-01-25 02:13:22 -05:00
Doug
87983ab610 chore: Remove an old todo
This was already done by moving the methods into Client.
2025-01-24 18:06:05 +01:00
Neil Johnson
66ffc3448e Update README.md
style

Signed-off-by: Neil Johnson <neil@matrix.org>
2025-01-24 11:20:20 +01:00
Neil Johnson
c6e308717d update maturity and contribution call to action 2025-01-24 10:56:05 +01:00
maan2003
4c4dd03411 fix(wasm): don't use tokio::time::{timeout,sleep} (#4573)
Tokio timeout and sleep don't work on wasm so provide alternative versions

---------

Signed-off-by: Manmeet Singh <manmeetmann2003@gmail.com>
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2025-01-23 08:57:11 +00:00
Benjamin Bouvier
2d0f873342 refactor: send respects to multiple automated lints and checks 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
041627ec4a test: rename EventFactory::into_sync to into_event 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
da4b8004f2 docs: add changelog entries 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
3428494468 refactor: rename SyncTimelineEvent to TimelineEvent 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
0c2046f93b refactor: have SyncTimelineEvent::push_actions be optional 2025-01-22 20:24:48 +01:00
Benjamin Bouvier
eb31f035e6 refactor: turn TimelineEvent into SyncTimelineEvent
As the comment noted, they're essentially doing the same thing. A
`TimelineEvent` may not have computed push actions, and in that regard
it seemed more correct than `SyncTimelineEvent`, so another commit will
make the field optional.
2025-01-22 20:24:48 +01:00
Kévin Commaille
df51404a14 chore(sdk): Add changelog for move of matrix_auth and oidc
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-01-22 20:22:13 +01:00
Kévin Commaille
3e78e441d4 refactor(sdk): Move oidc module to authentication::oidc
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-01-22 20:22:13 +01:00
Kévin Commaille
02c2e55855 refactor(sdk): Move matrix_auth module to authentication::matrix
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-01-22 20:22:13 +01:00
Stefan Ceriu
a528624274 chore(ffi): replace all the different timeline builder methods with one taking a configuration (#4561) 2025-01-22 13:56:53 +02:00
Ivan Enderlin
1d83d42e9f chore(ui): Remove Timeline::subscribe.
This patch removes `Timeline::subscribe`. There is
`Timeline::subscribe_batched`, which is the only useful API.
`subscribe` was only used by our tests, and `matrix-sdk-ffi` uses
`subscribe_batched` only.
2025-01-22 11:55:23 +01:00
Ivan Enderlin
4684cfb780 chore: Replace Timeline::subscribe by Timeline::subscribe_batched.
This patch changes all calls to `Timeline::subscribe` to replace them by
`Timeline::subscribe_batched`. Most of them are in tests. It's the first
step of a plan to remove `Timeline::subscribe`.

The rest of the patch updates all the tests to use
`Timeline::subscribe_batched`.
2025-01-22 11:55:23 +01:00
Stefan Ceriu
991c9ad610 chore(ci): simplify formatting checks by using xtask instead 2025-01-22 12:20:47 +02:00
Hubert Chathi
e826c54a42 Use the dehydrated device format implemented by vodozemac (#4421)
Signed-off-by: Hubert Chathi <hubertc@matrix.org>
2025-01-22 09:38:48 +01:00
Kévin Commaille
9ae658c1b9 feat(sdk): Enable HTTP/2 support
It became an optional default feature in reqwest 0.12, and we disable
the default features,
so I don't think it was meant to be disabled when the crate was
upgraded.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-01-22 09:08:00 +01:00
Benjamin Bouvier
4341aaf65c test: remove some uses of sync_timeline_event! in the base and sdk crates (#4565)
Part of #3716.
2025-01-21 14:33:22 +00:00
Jorge Martín
ad847a82c8 refactor: Remove TestHelper in pinned_events.rs
Use helper functions instead.
2025-01-21 12:56:19 +01:00
Jorge Martín
dad3e6839f test: update the code in pinned_events integration tests
This is done so the tests there use the new APIs based on `MatrixMockServer`.
2025-01-21 12:56:19 +01:00
Jorge Martín
d078ef6155 fix: fix mock_room_event not being able to properly filter out event ids since the regex was incorrectly parsed by wiremock 2025-01-21 12:56:19 +01:00
Benjamin Bouvier
210c5749f1 test: minimize usage of EventFactory::state_key
It was used in places where we could make use of other helpers, in some
cases. Also introduces the `room_avatar` helper to create the room
avatar state event.
2025-01-21 10:50:29 +01:00
Benjamin Bouvier
0c74abbc50 test: get rid of EventBuilder (#4560)
This gets rid of `EventBuilder`, and makes more usage of the
`EventFactory`, which is more ergonomic to create test events.

A large part of
https://github.com/matrix-org/matrix-rust-sdk/issues/3716.
2025-01-21 09:23:03 +00:00
Jorge Martín
dbadfe19b0 fix(timeline): avoid adding non-pinned events to the pinned events timeline when back paginating 2025-01-20 17:38:50 +01:00
dependabot[bot]
f3e43dbfa4 chore(deps): bump malinskiy/action-android/install-sdk@release/0.1.4
Bumps [malinskiy/action-android/install-sdk@release/0.1.4](https://github.com/malinskiy/action-android) from 0.1.4 to 0.1.7.
- [Release notes](https://github.com/malinskiy/action-android/releases)
- [Commits](https://github.com/malinskiy/action-android/compare/release/0.1.4...release/0.1.7)

---
updated-dependencies:
- dependency-name: malinskiy/action-android/install-sdk@release/0.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 16:22:38 +01:00
dependabot[bot]
b846a6dd81 chore(deps): bump crate-ci/typos from 1.28.3 to 1.29.4
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.28.3 to 1.29.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.28.3...v1.29.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 16:22:31 +01:00