Commit Graph

19 Commits

Author SHA1 Message Date
Ivan Enderlin
bbe8f17b1a refactor(common): Rename LockStoreError to CrossProcessLockError.
This patch renames the `LockStoreError` enum to `CrossProcessLockError`
to be consistent with the other types in the same module.

The `BackingStoreError` variant is also renamed to `TryLockError`.
2025-09-10 20:35:45 +02:00
Ivan Enderlin
f65bb6016c refactor(common): Rename store_locks to cross_process_lock. 2025-09-10 20:35:45 +02:00
Damir Jelić
216e878231 Revert "feat(base): Detecting invalid states in room upgrades."
This reverts commit c7f6190cff.
2025-06-09 18:08:03 +02:00
Damir Jelić
a120057ec3 Revert "fix(base): Revisit check_tombstone entirely."
This reverts commit 0478037b57.
2025-06-09 18:08:03 +02:00
Ivan Enderlin
0478037b57 fix(base): Revisit check_tombstone entirely.
This patch renames `check_tombstone` to `check_room_upgrades`.
Then it rewrites it **entirely** to remove all false-positives and
false-negatives. More importantly, the room versions are no longer
involved: they can't be compared or ordered, they must be treated as
opaque values.

This new version of `check_room_upgrades` does a first path to check
predecessor-successor consistency. Then it does a second version to
detect loops. This new algorithm is robust to absent `m.room.create`
events. Making them mandatory is left to another patch.

More tests are added, especially to ensure that `m.room.create` cannot
be overwritten, and to ensure loops or inconsistent predecessors and
successors are correctly detected.
2025-06-06 12:54:45 +02:00
Ivan Enderlin
c7f6190cff feat(base): Detecting invalid states in room upgrades.
This patch adds the `check_tombstone` response processor to
detect invalid state with room upgrades. One can check the new
`InconsistentTombstonedRooms` error to learn more about the detected
patterns.
2025-06-03 15:04:26 +02:00
Benjamin Bouvier
a8ca77f4fc feat(base): remove cached events when forgetting about a room 2025-01-13 17:36:33 +01:00
Jorge Martín
c143f981bd refactor(room_list): only display the knock state events if the current user can act on them
That is, if their power level allows them to either invite or kick users.
2024-10-29 12:55:39 +01:00
Timo Kösters
2f58cb1620 members: Simplify disambiguation logic when loading member list (#3184)
When all room members are loaded, we do not need an incremental member update. We know that parsing the /members response will only lead to more ambiguous names, not less. And because /members returns the complete list, we can directly use that list as the disambiguation map.

This improves the performance in my emulator from 56s to 9s and on a less performant device from 11mins to 11s (Tested experimentally on Matrix HQ using log statements in element android. If I have time, I will write a proper benchmark tomorrow.

See also https://github.com/matrix-org/matrix-rust-sdk/pull/3184#issuecomment-1986170631 for a more detailed benchmark run.

---

* members: Simplify disambiguation logic

* members: Prevent api misuse for receive_members

* members: Benchmark receive_all_members performance

* sdk: remove unused import

* sdk-base: rename `ApiMisuse` error to `InvalidReceiveMembersParameters`

* benchmarks: extract the member loading benchmark to `room_bench.rs`

* benchmarks: remove wiremock

* sdk-base: fix format

* sdk-base: try fixing tests

* benchmark: Provide some data to the store so the search and disambiguation happen

* benchmark: fix clippy

* benchmark: use a constant for `MEMBERS_IN_ROOM`

* sdk(style): reduce indent in `receive_all_members`

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: Benjamin Bouvier <public@benj.me>
2024-03-12 10:15:30 +00:00
Damir Jelić
ade3a09848 chore(base): Remove a leftover unwrap 2023-01-17 19:13:29 +01:00
Jonas Platte
b5b2eafbec refactor(base): Remove unused Error variants 2022-11-03 10:52:11 +01:00
Jonas Platte
27b0ea1aa0 refactor(crypto): Move EncryptionNotEnabled out of MegolmError
… into matrix_sdk_base::Error because it is never constructed in the
matrix_sdk_crypto crate that defines MegolmError.
2022-11-03 10:52:11 +01:00
Benjamin Kampmann
577b45f8ce activate encryption on base if crypto-store is activated, handle non_exhaustive errors raised 2022-04-20 16:19:55 +02:00
Benjamin Kampmann
d36220ed7c e2e-encrypted weak feature dependency 2022-04-20 14:26:54 +02:00
Benjamin Kampmann
8706ab68f8 fixing formatting 2022-02-24 16:57:39 +01:00
Benjamin Kampmann
eeea757719 clippy and formatting 2022-02-23 15:44:36 +01:00
Benjamin Kampmann
87cd9a3afc clean up base 2022-02-18 20:41:42 +01:00
Damir Jelić
1f1ae0059e docs: Remove the now unneeded doc cfg attributes 2021-11-09 10:43:42 +01:00
Damir Jelić
af74988a83 chore: Rename the crate folders to use dashes instead of underscores 2021-09-14 16:38:33 +02:00