Move `experimental_auto_back_pagination` off `EventCacheConfig` and onto
`ClientBuilder`, mirroring `enable_share_history_on_invite`. Previously the flag lived
behind an `RwLock`, was checked exactly once at first `subscribe()`,
and silently became a no-op if set afterwards.
End-to-end integration test through the public `SearchService`: a term that
exists only in a room's history (behind a gap) becomes searchable after
`run_search_backfill` pulls the history in and the search indexing task picks
it up. Exercises the whole chain: back-pagination queue -> event cache ->
search indexing task -> SearchService.
Add `matrix_sdk::event_cache::back_pagination_queue` as its own log target,
and a `TraceLogPacks::BackPagination` pack for it, instead of folding it into
the `EventCache`/`LatestEvents` packs. This lets a client capture the queue's
progress logs (requests, scheduling, per-room and per-sweep summaries) on
their own, without turning the whole event-cache subtree to trace.
Add `Client::run_search_backfill(BackPaginationStrategy)`, which starts the
sweep in the background and returns a `TaskHandle` to stop it (e.g. from an
iOS background-task expiration handler). `BackPaginationStrategy`
(`Foreground`/`Background`) lets the client tune how gently it runs.
Rename `enable_automatic_backpagination` to `enable_automatic_back_pagination`
for naming consistency.
These two commits were pushed directly to `main` by mistake, bypassing the PR review process:
- b6c521a85 test(oauth): reproduce hard logout from stale refresh after suspension
- 111567e2e fix(oauth): fetch server metadata before capturing the refresh token
This reverts both so `main` returns to its previous state. The change will be resubmitted as a normal pull request.
refresh_access_token validated the session hash and captured the refresh token before awaiting server_metadata(). On iOS the process can be suspended during that request; while suspended the cross-process lock lease lapses and a sibling process (the NSE) can refresh and rotate the token. On resume the app exchanged the now-stale token and was hard logged out with invalid_grant.
Fetch the server metadata and client id before taking the cross-process lock, and read the refresh token after the hash check, so a rotation that happens during the metadata request is detected as a hash mismatch and handled via the existing optimistic exit instead of exchanging a stale token.
When the app is suspended during the server_metadata() request of a token refresh, its cross-process lock lease lapses and a sibling process (the NSE) rotates the refresh token. On resume the app exchanges the now-stale token, gets invalid_grant, and is hard logged out.
This test reproduces that race. It fails on the current code, demonstrating the bug, and passes once refresh_access_token re-checks the session hash after fetching the server metadata.
The test failure here exists only to prove the bug, per the CONTRIBUTING commit guidelines.
When an original and its edit arrive in one batch, bulk_execute runs an Add
followed by an Edit of the same document. The Edit's removal only reconciled
committed documents, so the just-added uncommitted document was deleted by the
delete-by-term yet never re-added, dropping it from the index. Track each
uncommitted add's deletion key so the removal reconciles it too.
get_most_recent_edit indexed the latest m.replace regardless of whether it was
a valid replacement, letting any user rewrite another user's indexed message.
Validate edits with check_validity_of_replacement_events (matching sender, type,
etc.), as the timeline does, before indexing them.
Previously the search index only handled plain-text `m.room.message` events and
everything else hit `MessageTypeNotSupported` and was silently dropped.
This decouples the index from Ruma event types and broadens coverage with the
search crate now being content-agnostic. `RoomIndexOperation::Add/Edit` carry a
new `IndexableEvent` instead of `OriginalSyncRoomMessageEvent` and `make_doc`
builds a document straight from that struct. The logic for extracting the text
from the messages is now within the main SDK crate.
Types added:
* Image, Video, Audio and File for filename + caption
* Emote, Notice and ServerNotice for body
* Location for description
* Sticker for Sticker and alt text
* and finally Polls for question and answers
- Adds a method to check whether the server supports everything
necessary to use the User Status feature.
- Removes the `unstable-msc4426` feature as it was enabled by default in
the FFI and there seems little benefit to disabling it at this level.
This patch changes the `origin_server_ts` value from 151393755000000
(which is Sun Oct 15 2451 01:46:40 GMT+0000) to 1784626598
which is today. Otherwise, it makes Tantivy to panic, see
https://github.com/matrix-org/matrix-rust-sdk/issues/6772 to learn more.
This patch improves the `test_clear_all_events` test by
testing all possible `LinkedChunkId`, and adds the new
`test_clear_all_events_for_specific_room` test to test the new `room_id:
Option<&RoomId>` argument of `clear_all_tests`.
This patch also removes the `test_remove_room` since the `remove_room`
method has been… removed.
`matrix_sdk_base::Client::forget_room` calls
`EventCacheStore::remove_room` to forget a room. This is wrong for
multiple reasons:
- it hits the store directly without emptying the in-memory data in the
Event Cache caches (like `RoomEventCache` or `ThreadEventCache`),
- it removes data related to `RoomEventCache` only: it misses
`ThreadEventCache`s.
This patch removes the default implementation for
`EventCacheStore::remove_room`. It removes the method entirely from the
trait. Instead, it improves `EventCacheStore::clear_all_events` to add
an optional `RoomId`.
Then, this patch adds `EventCache::forget_room` which reuses the
`event_cache::states::StateLock::clear_and_reload` method, with the
addition of the optional `RoomId`.
This patch adds the `EventCacheStore::remember_thread` to remember
a thread exists. It doesn't create any `LinkedChunk`, it's just
here list all threads. It's going to be useful to fix a bug with
`Client::forget_room`, but next to implement proper thread list support.
This patch moves
```rust
self.encryption.encode_key(keys::LINKED_CHUNK, linked_chunk_id.storage_key())
```
to a new `Encryption::encode_linked_chunk` method, so that the code
becomes:
```rust
self.encryption.encode_linked_chunk_id(keys::LINKED_CHUNK, &linked_chunk_id)
```