perf(xmpp): fix slow MAM/MUC-MAM and move OMEMO decryption off the main
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s

thread

- Replace O(n^2) origin-id/stanza-id lookups in AppModel with hash
  indexes
  and stop rebuilding the whole index on every unseen stanza-id, so
  archive
  application no longer grows quadratically with history size.
- Run OMEMO decryption on a serial background queue instead of the main
  actor, and decrypt archived stanzas in small batches with a shorter
  yield,
  keeping the UI responsive during large archive catch-ups.
- Show the "Синхронизация истории…" banner only for the one-page
  bootstrap
  window; incremental backlog catch-up continues silently in the
  background.
- Fix MUC-MAM: publish decoded group mutations at the end of room
  catch-up;
  they were previously accumulated and then silently dropped.
- Retry a failed catch-up pass automatically (bounded) and lengthen the
  query/apply timeouts so a single slow page no longer leaves history
  unloaded until the next app activation.
This commit is contained in:
wt committed 2026-08-17 15:32:05 +07:00
1 parent dee7e94e92
commit 9b56d2ebcf
8 files changed
+329 -167

No files matched your search

+3 -2
View File
@@ -7,8 +7,9 @@ final class ArchiveMessageBatchPolicyTests: XCTestCase {
XCTAssertGreaterThan(ArchiveMessageBatchPolicy.pageSize, 0)
}
func testOnlyOneStanzaIsDecodedPerMainActorSlice() {
XCTAssertEqual(ArchiveMessageBatchPolicy.decodeSliceSize, 1)
func testStanzasAreDecodedInSmallBatchesPerMainActorSlice() {
XCTAssertGreaterThan(ArchiveMessageBatchPolicy.decodeSliceSize, 0)
XCTAssertLessThanOrEqual(ArchiveMessageBatchPolicy.decodeSliceSize, 16)
XCTAssertGreaterThan(ArchiveMessageBatchPolicy.interSliceDelayNanoseconds, 0)
}