Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase #3

Merged
merged 1,405 commits into from
Mar 3, 2025
Merged
Changes from 1 commit
Commits
Show all changes
1405 commits
Select commit Hold shift + click to select a range
d5d9898
feat: Upgrade Ruma to 0.12.1
zecakeh Feb 3, 2025
05814c5
refactor(ffi): Map client API errors to `ClientError::MatrixApi`, con…
jmartinesp Feb 1, 2025
f27eb4d
fix[oidc]: fix docstring in oidc module
JoFrost Feb 3, 2025
77a67de
fix(ui): Fix performance of `ReadReceiptTimelineUpdate::apply`.
Hywan Feb 3, 2025
5e1bae0
feat(ffi): Add `RoomPreview::forget` action in the FFI layer
jmartinesp Feb 4, 2025
0d4bc65
chore: Enable releases for the test crates
poljar Feb 3, 2025
4c46e42
chore: Release matrix-sdk version 0.10.0
poljar Feb 4, 2025
bdab995
doc(changelog): Add entries for the performance improvement patches.
Hywan Feb 4, 2025
1dc20aa
test(timeline): use the `MatrixMockServer` in integration/timeline/re…
bnjbvr Jan 22, 2025
cd8f5cf
test(timeline): use the `MatrixMockServer` in integration/timeline/echo
bnjbvr Feb 4, 2025
b74d64a
test(timeline): use the `MatrixMockServer` in integration/timeline/edit
bnjbvr Feb 4, 2025
5e9d291
chore(ui): Clone items only once when subscribing.
Hywan Jan 27, 2025
892cb91
refactor(ui): Move `TimelineStream` into the new `subscriber` module.
Hywan Jan 29, 2025
d85d6cf
refactor(ui): Rename `TimelineStream` to `TimelineWithDropHandle`.
Hywan Jan 29, 2025
1d52073
task(ui): Add the `SkipCount` type to help computing the `count` for …
Hywan Jan 29, 2025
e07212d
task(ui): Add `TimelineMetadata::subscriber_skip_count`.
Hywan Jan 29, 2025
0a520e4
task(ui): Apply the `Skip` higher-order stream for the `Timeline`.
Hywan Jan 29, 2025
51feda1
task(ui): `TimelineStateTransaction::commit` adjusts the `Skip`'s count.
Hywan Jan 29, 2025
7e59ae9
featui): `Timeline::subscribe()` supports lazy backwards pagination.
Hywan Jan 29, 2025
337bc2c
doc(ui): Fix a typo.
Hywan Jan 29, 2025
1d18ab0
test(ui): Improve the `assert_timeline_stream` macro.
Hywan Jan 30, 2025
7eae832
test: `set_timeline_prev_batch` takes anything that implements `Into<…
Hywan Jan 31, 2025
5320d95
test(ui): Test the `Timeline` lazy backwards pagination.
Hywan Jan 31, 2025
88caf11
chore(ui): Rename `Timeline::subscribe` to `subscribe_raw`.
Hywan Jan 31, 2025
d66fe79
task(ui): Create `TimelineSubscriber`.
Hywan Jan 31, 2025
4212691
fix(ui): Don't use `0` as the initial value for `Skip`.
Hywan Feb 3, 2025
2ea3987
fix: Add `github.com/Hywan/eyeball` in the `allow-git` list.
Hywan Feb 4, 2025
8a76587
chore: Fallback to `jplatte/eyeball` instead of `Hywan/eyeball`'s fork.
Hywan Feb 4, 2025
0f4b3aa
Merge branch 'main' into media-cache-auto-cleanup
zecakeh Feb 4, 2025
ed18c51
fix: Fix changelogs for new media service feature after new release
zecakeh Feb 4, 2025
954b16a
Merge pull request #4603 from zecakeh/media-cache-auto-cleanup
Hywan Feb 5, 2025
3e02d90
chore(sdk): Remove `RoomEventCacheUpdate::Clear`.
Hywan Feb 5, 2025
ed8c1d5
doc(sdk): Add #4627 in the `CHANGELOG.md`.
Hywan Feb 5, 2025
dddbcfb
fix(ffi): Align `RoomList::preview_room` with `Client::get_room_previ…
jmartinesp Feb 5, 2025
d8f3750
chore(ffi): reduce the verbosity of the store locks and ambiguity map
stefanceriu Feb 5, 2025
2291a61
ci: add a new feature set to test experimental-oidc too
bnjbvr Feb 4, 2025
f9ff4ff
feat(ffi): add support for starting and responding to user verificati…
stefanceriu Jan 29, 2025
ce44c6e
chore(base): don't show timeline verification requests as last messages
stefanceriu Feb 5, 2025
e00d57f
test: wait for the redact endpoint to be hit in `test_abort_before_be…
bnjbvr Feb 6, 2025
6c2a88c
test: Fix flaky `test_publishing_room_alias`
jmartinesp Feb 6, 2025
83dd11e
chore(ffi): expose the whole sender profile when receiving a verifica…
stefanceriu Feb 7, 2025
4b6dd5c
fix(ffi): `Client::resolve_room_alias` was mapping the wrong error type
jmartinesp Feb 7, 2025
9f2c572
fix(timeline): maintain aggregations when an event is deduplicated (#…
bnjbvr Feb 10, 2025
8d74d46
chore(ffi): expose `UserIdentity` `was_previously_verified` and `has_…
stefanceriu Feb 10, 2025
a5f0473
test(timeline): use the `MatrixMockServer` and `EventFactory` in inte…
bnjbvr Feb 5, 2025
357b36b
refactor(timeline): simplify transition from unencrypted -> encrypted
bnjbvr Feb 5, 2025
7b77b19
refactor(timeline): get rid of the optional in `is_room_encrypted` field
bnjbvr Feb 6, 2025
69588d5
test(timeline): use a builder pattern to create a `TestTimeline`
bnjbvr Feb 6, 2025
65ee18a
feat(sqlite): Run VACUUM operation after removing a room
zecakeh Feb 11, 2025
8042abe
fix(recovery): Delete the known secrets from 4s when disabling recovery
poljar Feb 5, 2025
654885a
fix(ui): Demote aggregation target not found log to TRACE level
zecakeh Feb 11, 2025
2999d10
fix(ffi): check that our own device is cross-signed before responding…
stefanceriu Feb 11, 2025
9db137a
refactor(common): `LinkedChunk` can start by a gap.
Hywan Feb 10, 2025
bfbb354
chore(common): Split a test into 3 tests.
Hywan Feb 11, 2025
10b72ef
test(common): Update `test_replace_item`.
Hywan Feb 11, 2025
fce7999
chore(common) Split the `test_insert_items_at` tests.
Hywan Feb 11, 2025
84bb1ab
refactor(event cache): extract deduplication outside the `RoomEvents`…
bnjbvr Feb 12, 2025
10095f8
refactor(event cache): rename `RoomEvents::remove_events` to `remove_…
bnjbvr Feb 12, 2025
4a37d6e
refactor(event cache): move `remove_events_and_update_insert_position…
bnjbvr Feb 12, 2025
ceafc21
refactor(event cache): move the `Deduplicator` instance to `RoomEvent…
bnjbvr Feb 12, 2025
aec4d37
refactor(event cache): fold all_deduplicated computation into `collec…
bnjbvr Feb 12, 2025
51e9df8
chore(timeline): add some logs when fetching a reply details
bnjbvr Feb 10, 2025
ddd84e2
feat(timeline): support more timeline item content kinds in replied-t…
bnjbvr Feb 10, 2025
a5f115f
test(timeline): use the `MatrixMockServer` in integration/timeline/re…
bnjbvr Feb 10, 2025
c5856a3
test(timeline): rewrite and comment fetch_details() test
bnjbvr Feb 11, 2025
58099fd
test(timeline): add new tests for fetching replies that are UTD or st…
bnjbvr Feb 11, 2025
c9a6ae9
fix(tests): Prevent test flake by using different names for the test …
andybalaam Feb 12, 2025
25bb607
feat(crypto): Allow fetching encryption info using session ID
andybalaam Feb 12, 2025
714caae
chore(sqlite): Remove a useless indentation.
Hywan Feb 10, 2025
ed16e91
fix: `RoomEventCache::subscribe` is now infallible.
Hywan Feb 11, 2025
d45adde
feat(base): Add `EventCacheStore::filter_duplicated_events`.
Hywan Feb 12, 2025
1918bd5
chore(base): Rename variables.
Hywan Feb 12, 2025
28cd8be
refactor(event cache): rename `Deduplicator` to `BloomFilterDeduplica…
bnjbvr Feb 12, 2025
b95cf79
refactor(event cache): move the gist of deduplication into `BloomFilt…
bnjbvr Feb 12, 2025
faa0e6e
feat(event cache): allow using the bloom filter OR the store to dedup…
bnjbvr Feb 12, 2025
2ae142f
refactor(event cache): get rid of a few generics
bnjbvr Feb 12, 2025
8a64922
test(event cache): address review comments and add a test for storage…
bnjbvr Feb 13, 2025
31e78c2
refactor(oidc): Only support public clients (#4634)
zecakeh Feb 13, 2025
12c3272
feat(common): Add a simple TTL cache implementation
poljar Feb 12, 2025
f2ad11a
refactor(client): Create a common struct for client caches
poljar Jan 29, 2025
aa9aef4
refactor: Rename Oidc::account_management_url to fetch_account_manage…
poljar Jan 29, 2025
861078a
feat: Add a memoized variant of Oidc::fetch_account_management_url
poljar Jan 29, 2025
1068d88
fix(event cache store): shortcut when there's no duplicate events to …
bnjbvr Feb 13, 2025
b311197
feat(sdk): Only allow TLS 1.2 or newer
zecakeh Feb 8, 2025
9c9944a
chore: Update changelog for TLS 1.2
zecakeh Feb 11, 2025
c6c7307
Merge branch 'main' into qr-login-oauth2
zecakeh Feb 13, 2025
c6d2ab4
chore: Fix changelog location
zecakeh Feb 13, 2025
51a1cd3
Merge pull request #4604 from zecakeh/qr-login-oauth2
poljar Feb 13, 2025
c4a9059
Merge branch 'oidc_e2e'
poljar Feb 13, 2025
dadd01a
chore: fix benchmarks and use the MatrixMockServer in there too
bnjbvr Feb 13, 2025
910a5ce
ci: add a task to compile benchmarks
bnjbvr Feb 13, 2025
534cd59
doc: remove internal links to macro
bnjbvr Feb 13, 2025
28a4918
chore(test): Increase the timeout for the sync service offline mode test
poljar Feb 13, 2025
0b7140c
bench: add a benchmark to measure how long it takes to fill a timelin…
bnjbvr Feb 13, 2025
9f47201
bench: add a `profiling` profile that doesn't enable LTO for quick re…
bnjbvr Feb 13, 2025
9de6d28
logging(crypto): Add more logs when identity or devices change
BillCarsonFr Feb 4, 2025
38e2864
fix: Remove support for MSC3575.
Hywan Jan 14, 2025
d3b3b4d
chore(base): Remove the `sliding_sync` module.
Hywan Jan 20, 2025
f33d104
refactor(base): Remove the `sliding_sync::http` re-export.
Hywan Feb 5, 2025
20dd15e
fix(timeline): Don't add events to the pinned events timeline when we…
jmartinesp Feb 7, 2025
f28c64b
test: modify pinned event tests to make sure we don't add events from…
jmartinesp Feb 7, 2025
97d772d
test: reverse the logic behind `test_focused_timeline_reacts` so it c…
jmartinesp Feb 13, 2025
6294212
change(crypto): have the RoomIdentityProvider return processing chang…
stefanceriu Feb 17, 2025
1c11497
refactor(oidc): Remove method to authorize arbitrary scope
zecakeh Feb 13, 2025
59f9d12
perf(timeline): make replacing replies much faster by indexing replies
bnjbvr Feb 13, 2025
07f0017
feat(common): Introduce `Chunk::lazy_previous` in the `LinkedChunk`.
Hywan Feb 17, 2025
6411d27
chore(deps): bump crate-ci/typos from 1.29.5 to 1.29.7
dependabot[bot] Feb 17, 2025
e9a34f6
refactor(oidc): Remove support for deserializing previous UserSession…
zecakeh Feb 17, 2025
ca392b0
chore: Add changelog for UserSession deserialization
zecakeh Feb 17, 2025
334c66b
task(base): Update `EventCacheStore` to add `load_last_chunk` and `lo…
Hywan Feb 10, 2025
e2a2f32
task(sqlite): Implement `load_last_chunk` and `last_previous_chunk`.
Hywan Feb 10, 2025
bed4d50
test(sqlite): Test `SqliteEventCacheStore::load_last_chunk` and `load…
Hywan Feb 11, 2025
7252a68
test(common): Test `RelationalLinkedChunk::load_last_chunk` and `load…
Hywan Feb 11, 2025
f9c6f89
feat(common): Detect cycles when loading last chunk of `LinkedChunk`.
Hywan Feb 18, 2025
0e4d8ec
feat(sqlite): Detect cycles when loading last chunk of `LinkedChunk`.
Hywan Feb 18, 2025
d656648
doc(sqlite): Fix typos in comments.
Hywan Feb 18, 2025
6bc9dc5
test(sdk): Improve a test.
Hywan Feb 18, 2025
8d9d83f
feat(ffi): add `history_visibility_override` param to the create room fn
jmartinesp Feb 6, 2025
2671769
fix(compilation): fix benchmark compilation on non-linux platforms
bnjbvr Feb 18, 2025
e03d40e
chore(sdk): Rename `RoomEvents::with_initial_chunks`.
Hywan Feb 5, 2025
155042e
task(common): `LinkedChunkBuilder` gains `from_last_chunk` and `inser…
Hywan Feb 10, 2025
8fcd5a9
test(sdk): Update tests.
Hywan Feb 10, 2025
096d478
chore(base): Split `LinkedChunkBuilder` and create `LinkedChunkBuilde…
Hywan Feb 10, 2025
1319558
test(base): Add `test_linked_chunk_incremental_loading`.
Hywan Feb 11, 2025
716958b
test(common): Add tests for `LinkedChunkBuilder::from_last_chunk`.
Hywan Feb 11, 2025
217429c
test(common): Add tests for `LinkedChunkBuilder::insert_new_first_chu…
Hywan Feb 11, 2025
a8f7939
doc(ui): Fix a typo.
Hywan Feb 11, 2025
d6120a5
doc(sdk): Events from `BackPaginationOutcome` are deduplicated…
Hywan Feb 11, 2025
fbd8b9c
chore(sdk): Remove useless indentations.
Hywan Feb 14, 2025
0aae72c
feat(sdk): The `EventCache` loads only the last chunk when initialised.
Hywan Feb 10, 2025
bfec34d
task(sdk) Add `RoomEventCacheState::load_more_events_backwards`.
Hywan Feb 10, 2025
d9e9006
feat(sdk): `event_cache::Pagination::run_backwards` paginates in the …
Hywan Feb 10, 2025
7d4dfb5
fix(sdk): Change semantics about duplicated events for a backwards pa…
Hywan Feb 14, 2025
a43ce05
task(sdk): `LinkedChunkBuider::load_previous_chunk` supports `lazy_pr…
Hywan Feb 17, 2025
9ad7ca8
test(sdk): Write a full integration test for the event cache lazy-loa…
Hywan Feb 11, 2025
00ae386
test(sdk): Test `RoomEvents::debug_string`.
Hywan Feb 17, 2025
5c7a733
task(common): `LinkedChunkBuilder` detects cycles.
Hywan Feb 18, 2025
a055aa3
chore(sdk): Fix comments and rename variables.
Hywan Feb 18, 2025
2eb2ae7
refactor(oidc): Use the `GET /auth_metadata` Matrix endpoint (#4673)
zecakeh Feb 18, 2025
6c57003
feat(sqlite) Add an index on `events.event_id` and `.room_id`.
Hywan Feb 18, 2025
7a06bdb
Rename snapshots to reduce filename length (#4625)
bitfriend Feb 19, 2025
3495cab
refactor(common): `builder::LinkedChunkBuilder::*` becomes `lazy_load…
Hywan Feb 19, 2025
5c57631
refactor(event cache): simplify flow when deciding to resolve a gap
bnjbvr Feb 19, 2025
017a947
doc(timeline): fix a broken link to all_remote_events
bnjbvr Feb 17, 2025
b9c7ffe
doc(timeline): tweak comment in pagination to explain why it's correct
bnjbvr Feb 19, 2025
c3fc310
refactor(event cache): simplify back-pagination
bnjbvr Feb 19, 2025
a25acf7
feat(common): `Update::RemoveChunk` emits `VectorDiff::Remove`.
Hywan Feb 19, 2025
23f72ba
test(common): Test ability for `AsVector` to generate several `Vector…
Hywan Feb 20, 2025
3f5efc1
docs(crypto): Update some docs for the InboundGroupSession
poljar Feb 19, 2025
61fa339
refactor(crypto): Add a constructor to create an InboundGroupSession …
poljar Feb 19, 2025
30589ca
refactor(event cache): use `Option<&mut>` in `Chunk::unlink`
bnjbvr Feb 20, 2025
60efcbc
refactor(event cache): use `Option<&mut>` in `Chunk::insert_before`
bnjbvr Feb 20, 2025
f56bc4c
chore: Bump nightly
jplatte Feb 20, 2025
1373f99
refactor: Use NonZeroUsize::new + unwrap in const contexts
jplatte Feb 20, 2025
f900db4
feat(sdk): Re-export the base crate's store module
jplatte Feb 20, 2025
d545419
test(common): Add `lazy_loader::from_all_chunks`.
Hywan Feb 19, 2025
05be621
task: Remove all usages of `LinkedChunkBuilderTest`.
Hywan Feb 19, 2025
bdf5fad
chore(common): Remove `LinkedChunkBuilderTest`.
Hywan Feb 19, 2025
90ac218
test: rename some MatrixMockServer helpers functions to make it clear…
bnjbvr Feb 20, 2025
0a4db30
refactor(oidc): Move `qrcode` module inside `oidc`
zecakeh Feb 18, 2025
254ce89
refactor(oidc): Use OidcBackend with LoginWithQrCode
zecakeh Feb 18, 2025
25d3999
chore: Add changelog for moving qrcode module
zecakeh Feb 19, 2025
d4b92de
refactor(oidc): Remove support for OIDC RP-Initiated logout
zecakeh Feb 17, 2025
55f5148
refactor(oidc): Only revoke one token for logout
zecakeh Feb 17, 2025
2f3cab4
chore: Add changelog for Oidc::logout
zecakeh Feb 17, 2025
242a104
doc(event cache): clarify that `RoomEvents::updates()` is only for st…
bnjbvr Feb 19, 2025
4c115b6
feat(event cache): don't store a gap if we've deduplicated all events…
bnjbvr Feb 20, 2025
4f47868
feat(linked chunk): allow replacing a linked chunk's content with a r…
bnjbvr Feb 20, 2025
e64cb2c
feat(event cache): implement `RoomEventCacheState::shrink_to_last_chunk`
bnjbvr Feb 19, 2025
66b9d33
feat(event cache): shrink the linked chunk upon gappy syncs
bnjbvr Feb 20, 2025
39c6481
feat(event cache): include the lazy previous chunk in the debug strin…
bnjbvr Feb 24, 2025
f3f37a3
fix(event cache): override `reached_start` when there's a mismatch be…
bnjbvr Feb 24, 2025
43c066e
task(base): `EventCacheStore::filter_duplicated_events` returns `Posi…
Hywan Feb 21, 2025
f9ce762
task(sdk): Redesign `Deduplicator::filter_duplicate_events`.
Hywan Feb 21, 2025
a362584
task(sdk): Use `DeduplicationOutcome` to remove events in their corre…
Hywan Feb 21, 2025
c1a13f7
test(sdk): Test `sort_events_by_position_descending`.
Hywan Feb 24, 2025
9bd7cfd
test(sdk): Rename a test.
Hywan Feb 24, 2025
a71f5bf
test(sdk): Test `Deduplicator` filters events in the input.
Hywan Feb 24, 2025
0b12ec2
test(sdk): `Deduplicator` excludes invalid events.
Hywan Feb 24, 2025
22ba168
chore(sdk): Rename a test helper and some variables.
Hywan Feb 24, 2025
30a9a97
tes(sdk): `Deduplicator` dispatches duplicated events in memory vs in…
Hywan Feb 24, 2025
019b4a2
chore(common): Rename `EmptyChunk` to `EmptyChunkRule`.
Hywan Feb 24, 2025
8c2dcd7
task(sdk): Make the code more robust around event removals.
Hywan Feb 24, 2025
d21a415
chore(sdk): Code cleanup.
Hywan Feb 24, 2025
37b62df
test(sdk): Add a big test for a deduplication + event removals.
Hywan Feb 24, 2025
5dd5710
feat(event cache): auto-shrink a room event cache's chunk after all l…
bnjbvr Feb 20, 2025
e5f6d02
ci: use an hardcoded version of cargo-machete in CI (#4710)
bnjbvr Feb 25, 2025
7b52306
feat(base): Add `EventCacheStore::find_event`.
Hywan Feb 24, 2025
475ad79
fix(sdk): `RoomEventCache::event` looks inside the store.
Hywan Feb 24, 2025
0819ab1
refactor(event cache): apply review comments of #4708
bnjbvr Feb 25, 2025
21960a5
chore(event cache): add more logs to the auto-shrinking mechanism
bnjbvr Feb 25, 2025
fda9177
refactor(oidc): Remove support for Pushed Authorization Requests
zecakeh Feb 20, 2025
09513ea
refactor(oidc): Only support authorization URL parameters defined in …
zecakeh Feb 20, 2025
8c1966a
refactor(crypto): Don't require `event_type` to return a static string
poljar Feb 19, 2025
506a36b
fix(crypto): Fix the serialization of DecryptedOlmV1Event
poljar Feb 19, 2025
3bb8833
refactor(crypto): Use the DecryptedOlmV1Event type when encrypting to…
poljar Feb 19, 2025
b2356a0
doc(crypto): Improve the documentation for the encrypted Content seri…
poljar Feb 25, 2025
b0ccc94
refactor(crypto): Simplify some tests by using a session created from…
poljar Feb 20, 2025
e1d05fa
refactor(crypto): Use struct destructuring instead of separate field …
poljar Feb 20, 2025
bfa89bc
feat(crypto): Add support for the shared_history flag defined in MSC3061
poljar Feb 20, 2025
9a33385
test(crypto): Test that the shared history flag gets set when creatin…
poljar Feb 20, 2025
af62f09
test(crypto): Test that the shared history flag gets set when we ours…
poljar Feb 20, 2025
c1e28aa
test(crypto): Add a snapshot test for the inbound group session pickle
poljar Feb 20, 2025
ea073f5
doc(crypto): Document all the arguments of the InboundGroupSession::n…
poljar Feb 25, 2025
3e3bff7
fixup! feat(crypto): Add support for the shared_history flag defined …
poljar Feb 25, 2025
19df945
fix(ffi): Correctly indicate OIDC support when fetching metadata fails.
pixlwave Feb 25, 2025
7841ed8
refactor(event cache): remove `RoomPagination::hit_timeline_end()`
bnjbvr Feb 26, 2025
74bc3df
refactor(event cache): don't hold onto a live instance of the paginat…
bnjbvr Feb 26, 2025
86b5cb4
refactor(event cache): split disk and network paginations into smalle…
bnjbvr Feb 26, 2025
061a2f7
refactor(event cache): handle pagination status in a single location
bnjbvr Feb 26, 2025
4833403
refactor(event cache): simplify signature of `RoomEventCacheState::wi…
bnjbvr Feb 26, 2025
15fd892
chore(event cache): remove the `sync_` prefix from timeline_events_diff
bnjbvr Feb 26, 2025
2e1b051
refactor(event cache): split handling a successful network pagination…
bnjbvr Feb 26, 2025
1feb77b
doc(event cache): tweak `paginate_backwards_with_network` doc comment
bnjbvr Feb 26, 2025
52909b0
test(oidc): Simplify qrcode login tests
zecakeh Feb 24, 2025
6026b0c
test(oidc): Use MatrixMockServer for qrcode login tests
zecakeh Feb 24, 2025
5791ac9
test(oidc): Add an OauthMockServer and use it for qrcode login tests
zecakeh Feb 24, 2025
9b406cf
test(oidc): Use mock server and client as much as possible
zecakeh Feb 25, 2025
54ab46d
test(oidc): Use MatrixMockServer for cross-signing test
zecakeh Feb 26, 2025
f02a7d1
test(sdk): Run integration tests for experimental-oidc feature too
zecakeh Feb 26, 2025
7dba05f
feat(sdk): Add `Room::report_room`
hanadi92 Feb 26, 2025
f9f389d
chore(event cache): remove unused errors
bnjbvr Feb 26, 2025
4742aa2
fix(event cache): wait for the initial previous-batch token, if there…
bnjbvr Feb 26, 2025
b422b93
chore(crypto): Lower a very noisy log line
poljar Feb 27, 2025
7a0bf9b
chore(sdk): Don't repeat a log line about the list of users for a /ke…
poljar Feb 27, 2025
55143e1
refactor(event cache): call /messages directly in the room pagination
bnjbvr Feb 27, 2025
ee710e3
test(event cache): turn test into failing regression test
bnjbvr Feb 27, 2025
87a6037
refactor(event cache): consolidate logic around returning the previou…
bnjbvr Feb 27, 2025
f7297ed
refactor(event cache): get rid of `get_or_wait_for_token`
bnjbvr Feb 27, 2025
a67f9d5
chore(sdk): Log all updates.
Hywan Feb 28, 2025
a0282ec
refactor(timeline): Move the decryption retrying into a separate struct
andybalaam Feb 24, 2025
c74ecff
refactor(timeline): Move finding retry indices into DecryptionRetryTask
andybalaam Feb 24, 2025
d447342
refactor(timeline): Split finding retry indices into its own function
andybalaam Feb 24, 2025
e84ad97
refactor(timeline): Adjust tests that retry decryption to wait with t…
andybalaam Feb 25, 2025
82d47d8
refactor(timeline): Pass requests to retry decryption through a chann…
andybalaam Feb 25, 2025
8976233
refactor(timeline): Move the code to find which events to redecrypt i…
andybalaam Feb 25, 2025
dbaa36e
refactor(timeline): Share should_retry logic between the two places w…
andybalaam Feb 25, 2025
8cd7085
refactor(crypto): Keep a long-lived DecryptionRetryTask in TimelineCo…
andybalaam Feb 25, 2025
95b53d7
chore: Tweak the weekly-report command to include PR numbers
poljar Feb 18, 2025
cecf15a
refactor(ffi): unify a bit more `Room::timeline_with_configuration` a…
bnjbvr Feb 27, 2025
f519522
refactor(ffi): move the `TimelineEventTypeFilter` to `timeline/config…
bnjbvr Feb 27, 2025
cc7fb63
refactor(sdk): Remove clone_request method
zecakeh Mar 3, 2025
83415ac
refactor(event cache): clear all pending updates when resetting/shrin…
bnjbvr Feb 24, 2025
d096559
feat(event cache): don't include useless updates when clearing/resett…
bnjbvr Feb 24, 2025
b5edc86
refactor(event cache): rename `clear` to `clear_pending`
bnjbvr Mar 3, 2025
5fd0cb0
chore(deps): bump bnjbvr/cargo-machete from 0.7.1 to 0.8.0
dependabot[bot] Mar 3, 2025
8b6e759
refactor(event cache): don't keep an empty events chunk before a gap
bnjbvr Feb 27, 2025
0924b2e
refactor(event cache): get rid of `EmptyChunkRule::Keep` which is onl…
bnjbvr Feb 27, 2025
9bc0d8b
refactor(event cache): rename `Chunk::len` to `Chunk::num_items`
bnjbvr Mar 3, 2025
def4be5
refactor(event cache): make use of `Chunk::num_items` when deciding w…
bnjbvr Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor(base): Use struct for media content in the MemoryStore
It is already a 3-tuple and we want to add more data so it will be clearer to use a stuct with named fields.

Signed-off-by: Kévin Commaille <[email protected]>
zecakeh committed Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 34c7dd48ae04ab0b1402e3229c51b2626439ca76
49 changes: 32 additions & 17 deletions crates/matrix-sdk-base/src/event_cache/store/memory_store.rs
Original file line number Diff line number Diff line change
@@ -39,11 +39,24 @@ pub struct MemoryStore {

#[derive(Debug)]
struct MemoryStoreInner {
media: RingBuffer<(OwnedMxcUri, String /* unique key */, Vec<u8>)>,
media: RingBuffer<MediaContent>,
leases: HashMap<String, (String, Instant)>,
events: RelationalLinkedChunk<Event, Gap>,
}

/// A media content in the `MemoryStore`.
#[derive(Debug)]
struct MediaContent {
/// The URI of the content.
uri: OwnedMxcUri,

/// The unique key of the content.
key: String,

/// The bytes of the content.
data: Vec<u8>,
}

// SAFETY: `new_unchecked` is safe because 20 is not zero.
const NUMBER_OF_MEDIAS: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(20) };

@@ -119,7 +132,11 @@ impl EventCacheStore for MemoryStore {

// Now, let's add it.
let mut inner = self.inner.write().unwrap();
inner.media.push((request.uri().to_owned(), request.unique_key(), data));
inner.media.push(MediaContent {
uri: request.uri().to_owned(),
key: request.unique_key(),
data,
});

Ok(())
}
@@ -133,10 +150,11 @@ impl EventCacheStore for MemoryStore {

let mut inner = self.inner.write().unwrap();

if let Some((mxc, key, _)) = inner.media.iter_mut().find(|(_, key, _)| *key == expected_key)
if let Some(media_content) =
inner.media.iter_mut().find(|media_content| media_content.key == expected_key)
{
*mxc = to.uri().to_owned();
*key = to.unique_key();
media_content.uri = to.uri().to_owned();
media_content.key = to.unique_key();
}

Ok(())
@@ -147,8 +165,8 @@ impl EventCacheStore for MemoryStore {

let inner = self.inner.read().unwrap();

Ok(inner.media.iter().find_map(|(_media_uri, media_key, media_content)| {
(media_key == &expected_key).then(|| media_content.to_owned())
Ok(inner.media.iter().find_map(|media_content| {
(media_content.key == expected_key).then(|| media_content.data.clone())
}))
}

@@ -157,10 +175,8 @@ impl EventCacheStore for MemoryStore {

let mut inner = self.inner.write().unwrap();

let Some(index) = inner
.media
.iter()
.position(|(_media_uri, media_key, _media_content)| media_key == &expected_key)
let Some(index) =
inner.media.iter().position(|media_content| media_content.key == expected_key)
else {
return Ok(());
};
@@ -176,21 +192,20 @@ impl EventCacheStore for MemoryStore {
) -> Result<Option<Vec<u8>>, Self::Error> {
let inner = self.inner.read().unwrap();

Ok(inner.media.iter().find_map(|(media_uri, _media_key, media_content)| {
(media_uri == uri).then(|| media_content.to_owned())
Ok(inner.media.iter().find_map(|media_content| {
(media_content.uri == uri).then(|| media_content.data.clone())
}))
}

async fn remove_media_content_for_uri(&self, uri: &MxcUri) -> Result<()> {
async fn remove_media_content_for_uri(&self, expected_uri: &MxcUri) -> Result<()> {
let mut inner = self.inner.write().unwrap();

let expected_key = uri.to_owned();
let positions = inner
.media
.iter()
.enumerate()
.filter_map(|(position, (media_uri, _media_key, _media_content))| {
(media_uri == &expected_key).then_some(position)
.filter_map(|(position, media_content)| {
(media_content.uri == expected_uri).then_some(position)
})
.collect::<Vec<_>>();