Skip to content

Avoid repeated message-history processing - #3539

Closed
holmesworcester wants to merge 9 commits into
10.0.0from
fix/ios-qss-processing
Closed

holmesworcester wants to merge 9 commits into
10.0.0from
fix/ios-qss-processing

Conversation

@holmesworcester

@holmesworcester holmesworcester commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Quiet repeatedly scanned and consumed old message history as new messages arrived. This change indexes verified message IDs/hashes and avoids repeatedly searching the frontend message list. TryQuiet/auth#39 separately supplies the accompanying cache of immutable cryptographic facts. Message signatures and current authorization are still checked.

The index handles OrbitDB's actual replication behavior: one head update can import an entire backlog. It discovers newly accepted ancestors once using canonical local-log reads. Authorization changes invalidate the index; unjoined heads wait for local acceptance. A pre-existing delayed-notification race after authorization changes or close is also fixed.

Seven QSS roster checks now assert visible members instead of waiting for an unasserted Tor status. Existing offline-status, message, private-channel, and history assertions remain intact.

This PR contains no native crypto adapter, sodium loader, crypto test hooks, or new crypto implementation. Backend package.json and webpack configuration match 10.0.0. Native OpenSSL work is preserved independently in #3541; this PR can be used with the existing libsodium implementation or a future native implementation.

Validation after separating native crypto:

  • Actual desktop QSS: all 168 passed with zero skips on the fresh package without the adapter: 64 multiplayer, 75 private-channel, and 29 single-client tests.
  • Backend: 896 standard tests, 12 Tor tests, and the large-file test passed.
  • Auth: 773 passed (87 existing skips). State-manager: 205 tests and 13 snapshots passed.
  • Native-free backend build/lint passed. E2E helper tests: 14 passed; E2E build/lint passed.
  • Real OrbitDB regression cases cover public/private backlogs and rejection of an impersonating ancestor. The concurrent scaling test processes 1,000 shared ancestors plus 100 heads with 1,100 consumes and no completed-history rescan.

The first public-QSS run passed 61/64: restoring P2P while Tor was still bootstrapping returned false and left the settings modal open, causing two dependent UI failures. The same build and unchanged suite then passed 64/64. The involved Tor-toggle code matches the release base; the initial failure is retained in the validation record. Existing test skips remain unchanged. Daybreak Blue accepted the processing-only split after 73 backend and 8 independent auth adversarial tests using standard sodium. No introduced signature-verification, impersonation, or privilege-escalation regression was found.

Fixes #3536. Advances #3537. Depends on TryQuiet/auth#39; targets 10.0.0. Graph traversal and contextual replay still grow with sigchain history. The earlier combined iPhone timings are not measurements of this branch alone.

@holmesworcester holmesworcester changed the title Keep iOS QSS message processing responsive Avoid repeated message-history processing Sep 15, 2026
@holmesworcester holmesworcester added the 11.3 Speculative-reuse caches, design-system alignment and small fixes label Sep 17, 2026
@holmesworcester

Copy link
Copy Markdown
Collaborator Author

Superseded by #3654, the forward-port to develop (merged as f32eb4f) with the develop-side interaction fixes and the audit-derived regression tests.

Passw pushed a commit to Passw/TryQuiet-quiet that referenced this pull request Sep 27, 2026
) (TryQuiet#3654)

Indexes verified message IDs/hashes in the channel store so a new head no longer re-decrypts and re-verifies the whole channel history, and the frontend missing-ID check is O(1). Forward-port of TryQuiet#3539 with the interaction fixes for TryQuiet#3559/TryQuiet#3569/DMs, auth pinned to 922f9490a (auth#39 cache + TryQuiet#42 typings). Daybreak Blue adversarial audit: six iterations, ACCEPT at a85fe17; 32 audit-derived regression tests. Authorization is monotonic today (no removal/rotation in production paths); a liveness test asserts entries become visible exactly once when keys or members arrive. Closes TryQuiet#3536, closes TryQuiet#3537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11.3 Speculative-reuse caches, design-system alignment and small fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant