Commit Graph

6538 Commits

Author SHA1 Message Date
Benjamin Bouvier
1cd87ca15d feat: Immediately fail if a sliding sync request failed
For sliding sync that starts both the actual sliding sync request along the e2ee requests,
we need to make sure that, in case of failure of sliding sync, we reset `pos` as soon as possible.
With the code before this patch, the sliding sync response might be available, but the whole
processing could be waiting for the e2ee requests to finish. In the updated version, we spawn
the e2ee requests in a background task, then run the sliding sync request immediately and fail
if it failed.

Another nice benefit is that the e2ee requests won't be interrupted in the middle of processing,
if the sliding sync changed parameters and we cancelled the whole sync a bit too early.

Fixes #2206.
2023-07-05 13:13:51 +02:00
Jonas Platte
afeb5dab24 sdk: Remove questionable use of assign! macro 2023-07-05 12:16:30 +02:00
Jonas Platte
206accb5fb Bump serde_html_form 2023-07-05 11:34:50 +02:00
Jonas Platte
0b24df991e Bump bs58 2023-07-05 11:34:50 +02:00
Jonas Platte
dd2fefa2f3 Bump indexmap 2023-07-05 11:34:50 +02:00
Jonas Platte
2b72df7c06 Bump itertools 2023-07-05 11:34:50 +02:00
Jonas Platte
71f7f7c69e Remove mentions of labs crates
There are none at the moment.
2023-07-05 11:34:50 +02:00
Jonas Platte
4ae63caa56 Bump bitflags dependency
2.3.3 contains some bug fixes, might be relevant.
2023-07-05 11:34:50 +02:00
Ivan Enderlin
b6908c0611 feat(ui): Change all_rooms batch size to 200
feat(ui): Change `all_rooms` batch size to 200
2023-07-05 10:46:01 +02:00
Ivan Enderlin
36419a7a1f chore: get rid of previous locking crypto-store methods
chore: get rid of previous locking crypto-store methods
2023-07-05 10:35:33 +02:00
Ivan Enderlin
12a1f25ec3 feat(ui): Change all_rooms batch size to 200.
`RoomListServer` defines an `all_room` sliding sync list. This list
starts in selective sync-mode, then it switches to growing sync-mode.
The previous batch size of the growing sync-mode was 50. This patch
updates it to 200, because empirically it seems a better value for
perceived performance.

This patch also rewrites how `State::next` is written. No change in the
code, just comestic.
2023-07-05 10:28:02 +02:00
Ivan Enderlin
a0f40606d4 Merge pull request #2208 from bnjbvr/only-restart-growing-on-errors
feat: Only restart growing the allRooms list in case of errors
2023-07-05 10:01:58 +02:00
Jonas Platte
da43d81095 ui: Keep loading indicator at the top when processing timeline events 2023-07-05 09:52:59 +02:00
Jonas Platte
5fa293b8ed crypto: Use HashMap inside DashMap
… instead of nesting DashMaps.
The previous type was tracking mutability at very fine-grained level for
no clear reason.
2023-07-04 19:50:45 +02:00
Jonas Platte
87782e9567 ffi: Expose EventTimelineItem::origin 2023-07-04 19:50:08 +02:00
Jonas Platte
f344aa7669 sdk: Add EventTimelineItem::origin 2023-07-04 19:50:08 +02:00
Mauro Romito
f4929fd064 joined members is now in the notification 2023-07-04 19:39:43 +02:00
Jonas Platte
cb2e97f06a Upgrade eyeball to 0.8 2023-07-04 16:22:45 +00:00
Nicolas Mauri
3db72101f3 sdk: Allow to update notification settings (#2135)
* sdk: Allow to update notification settings

* Add an event listener for push rule events

* Fix: simplify insertion and deletion of rules

* Fix: Limit rules cloning

* Fix: Unit tests

* Fix: set_room_notification_mode

* Fix: potential race condition when updating the local ruleset

* Refactor RuleCommands

* RuleCommands Unit Tests

* Fix: limit lock usage

* nit: use expression assignment by default

* nit: pass Ruleset by ownership in RuleCommands' ctor

* a few nits: use to_owned() for &str -> String; use free function for notify actions; use clone() where it's more obvious

and use explicit variants so we know we have to consider this match if we were to add a new variant later

* nit: rename RuleCommands::set_enabled to set_enabled_internal

* nit: test modules don't need to be publicized

* tidy tests

* nit: pass an owned RuleCommands in Rules::apply

* add comments/questions in Rules tests

* nit: no need to publicize the tests module

* tweak NotificationSettings tests too

* rustfmt

---------

Co-authored-by: Benjamin Bouvier <public@benj.me>
2023-07-04 15:29:57 +00:00
Benjamin Bouvier
bb34f69662 chore: get rid of previous locking crypto-store methods 2023-07-04 17:19:01 +02:00
Benjamin Bouvier
e8a306132a feat: Only restart growing the allRooms list in case of errors
When the sync has been terminated and restarts (e.g. an app is going from the background to the foreground), then
the sliding sync is always restarting in growing mode, independently of the previous state of the sync (error or normal
termination). This is something the current sliding sync proxy can't handle nicely, because it prioritizes a change in
parameters over live data; as a matter of fact, to alleviate the burden of the proxy, we can try to only restart in
growing mode if we ran into an error (and not if we had a normal termination).
2023-07-04 13:06:49 +02:00
Jonas Platte
7bcc886429 Re-format with latest rustfmt 2023-07-03 18:57:05 +02:00
Jonas Platte
37023fe90b Fix new clippy lint 2023-07-03 18:57:05 +02:00
Jonas Platte
cd4288391e Bump nightly toolchain version 2023-07-03 18:57:05 +02:00
Jonas Platte
b681f234a3 Upgrade criterion, pprof 2023-07-03 18:08:01 +02:00
Alfonso Grillo
147cd970c4 Map MSC3488 fields for UniFFI (#2187)
* Update ruma

* Refactor send_location

* Add timeline parser

* Fix code format

* Add zoom_level

* Update ruma

* Map zoom_level

* Format code

* Cleanup

* Refactor LocationContent

* Apply suggestion

* Fix format issue
2023-07-03 13:34:07 +00:00
Ivan Enderlin
10c9a47f01 Merge pull request #2197 from Hywan/test-ui-room-list-assert-equal 2023-07-03 13:36:55 +02:00
Ivan Enderlin
746b13071e Merge pull request #2198 from Hywan/test-integration-fix 2023-07-03 13:36:06 +02:00
Ivan Enderlin
c955de8331 test: Change the installer for setup-matrix-synapse.
There is a bug in Synapse and changing the installer seems to fix the
problem.
2023-07-03 12:47:24 +02:00
Ivan Enderlin
0c13b76d27 test(ui): Do strict assert comparison in some tests of RoomList.
It ensures that we know exactly what's happening here. Tests are still
valid without any changes in the expected data, but it prevents a
potential breaking.
2023-07-03 11:13:45 +02:00
Ivan Enderlin
4f84e33457 fix(ui): Add bump_event_types onto visible_rooms
fix(ui): Add `bump_event_types` onto `visible_rooms`
2023-07-03 10:04:31 +02:00
Ivan Enderlin
37ad562b4b test(sdk): Use async_test instead of tokio::test. 2023-07-03 09:36:45 +02:00
Ivan Enderlin
ed2d3bc5b3 chore(ui) Use a function to configure all_rooms and visible_rooms.
The Sliding Sync list `all_rooms` and `visible_rooms` of the `RoomList`
must have the exact same configurations for `sort`, `filters`, and
`bump_event_types`. Instead of maintaining the same code, this patch
adds a new function: `configure_all_or_visible_rooms_list` that
configures the lists exactly the same. This function also explicitely
configures `sort` so that we do no rely on the default values from
`SlidingSyncListBuilder`.
2023-07-03 09:22:32 +02:00
Ivan Enderlin
627a1613df fix(ui): Add bump_event_types onto visible_rooms.
This patch configures the same `bump_event_types` for the
`visible_rooms` list than for the `all_rooms` list, so that we may be
sure that the sorting/ordering is the same between the two lists.
2023-06-30 21:48:30 +02:00
Ivan Enderlin
f82fd896f9 chore(ui): Rename room_list module to room_list_service
chore(ui): Rename `room_list` module to `room_list_service`
2023-06-30 21:45:10 +02:00
Ivan Enderlin
9f90b6d4a8 chore(ui): Rename room_list module to room_list_service. 2023-06-30 19:59:13 +02:00
jonnyandrew
3180a1ba7c ffi: Expose proxy and insecure SSL settings (#2191)
Co-authored-by: Damir Jelić <poljar@termina.org.uk>
2023-06-30 15:31:20 +02:00
Benjamin Bouvier
4fbb3d2b63 xtask: add --features testing to most testing tasks 2023-06-30 12:41:04 +02:00
Benjamin Bouvier
66e1b94d31 test: add test for the generational counter invalidation 2023-06-30 12:41:04 +02:00
Benjamin Bouvier
d642c22db7 feat: implement a generation counter for the CryptoStore lock 2023-06-30 12:41:04 +02:00
Benjamin Bouvier
d72fd34325 Make pending local echoes sticky, take 2 (#2189)
* ui: Move EventSendState into timeline::event_item::local module

* [WIP] ui: Make pending local echoes stick to the bottom of the timeline

* test: update more test expectations

* chore: tweak comment to slightly better reflect reality

* nit: remove else after return

* fix: the item's insert position is insert_idx, not `items.len()` anymore

* fix: look for remote echo before local echo when processing send state

Previous code assumed that the latest timeline items would be the most recent, and that
if there was a remote echo, it would always be after the local echo, because of that.
That's not the case anymore, so we must look for possibly a remote echo first, and then
if we find it, apply the late update process.

Also, there might remain a day divider added by the local echo, if it were inserted last.
I'm not sure it covers all the cases, but I've now made it so that the day divider is removed
if it was the last element.

* feat: switch strategy; keep on pushing if there's nothing in the timeline yet

* Revert "test: update more test expectations"

This reverts commit 400cc93ba7c98042a28b5e8d5042899e854f6cff.

* test: reset test expectations

* Address review comments

* fix: don't mix up latest event with any status, with latest non-failed event index

---------

Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-06-30 09:37:49 +00:00
Richard van der Hoff
5348e7cc12 Airplane -> Aeroplane
For verification-by-emoji, the spec uses the word "Aeroplane" rather than
"Airplane". Element-web expects us to use the specced words (and will otherwise
complain about the lack of i18n data).

It seems like following the spec will help maintain consistency.
2023-06-30 10:45:52 +02:00
jonnyandrew
f508109d0c Fix reaction response resolution 2023-06-30 10:26:41 +02:00
Benjamin Bouvier
77290ff2c1 feat: Get rid of "common extensions"
Common extensions are confusing, and they've included `e2ee` and `to-device` by default. This is not a sane default anymore,
now that there's the concept of `EncryptionSync`: it's either we have the encryption sync that enables e2ee and to-device +
a room list sync that doesn't, OR we have a single room list that has both.

Room List was misconfigured to always use `e2ee` and `to-device`, which was incorrect when it's running with the `EncryptionSync`
in the background. This is now removed, and properly tested.
2023-06-30 09:56:29 +02:00
Richard van der Hoff
48a6bffc1e Merge branch 'release-matrix-sdk-crypto-js-0.1.0' 2023-06-29 17:02:40 +01:00
Ivan Enderlin
1958df22a9 fix(sdk): Change how SlidingSyncList::update_room_list handles updates for out of list rooms
fix(sdk): Change how `SlidingSyncList::update_room_list` handles updates for out of list rooms
2023-06-29 15:48:39 +02:00
Ivan Enderlin
91bf84714d feat(ffi): Add methods on RoomListItem so that full_room isn't necessary
feat(ffi): Add methods on `RoomListItem` so that `full_room` isn't necessary
2023-06-29 15:39:45 +02:00
Richard van der Hoff
757716c924 matrix-sdk-crypto-js v0.1.0 2023-06-29 15:22:00 +02:00
Richard van der Hoff
1b2b6c011b update changelog 2023-06-29 15:22:00 +02:00
Ivan Enderlin
bd148fd422 chore(ffi): RoomListItem::is_direct returns a bool. 2023-06-29 15:14:53 +02:00