Add global search backfill worker (#7860)

* Add search backfill worker

This will run on background at most once an hour while the device has internet connectivity and the device is charging and start back-paginating through the user's rooms to make sure the search results are populated.

It'll run for the maximum time the default workers allow, 10 minutes.

* Create `RustMatrixClient.Factory` AssistedFactory to help with DI and add `SearchBackfillService`

* Start search backfill when entering the search screen, just once. This should help getting initial search results if none or few are found at first
This commit is contained in:
Jorge Martin Espinosa
2026-10-07 12:41:19 +02:00
committed by GitHub
parent 9805422a8a
commit 3fe0e09e3c
27 changed files with 1104 additions and 73 deletions
@@ -43,6 +43,7 @@ fun workManagerTag(sessionId: SessionId, requestType: WorkManagerRequestType): S
val prefix = when (requestType) {
WorkManagerRequestType.NOTIFICATION_SYNC -> "notifications"
WorkManagerRequestType.DB_VACUUM -> "db_vacuum"
WorkManagerRequestType.SEARCH_BACKFILL -> "search_backfill"
}
return "$prefix-$sessionId"
}
@@ -50,4 +51,5 @@ fun workManagerTag(sessionId: SessionId, requestType: WorkManagerRequestType): S
enum class WorkManagerRequestType {
NOTIFICATION_SYNC,
DB_VACUUM,
SEARCH_BACKFILL,
}