Skip to content

fix: recover after key-package exhaustion [WPB-27396] - #22363

Open
e-maad wants to merge 2 commits into
mainfrom
fix/mls-recovery-key-packages-exhaustion-WPB-27396
Open

fix: recover after key-package exhaustion [WPB-27396]#22363
e-maad wants to merge 2 commits into
mainfrom
fix/mls-recovery-key-packages-exhaustion-WPB-27396

Conversation

@e-maad

@e-maad e-maad commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
BugWPB-27396 [Web] Recover MLS conversations after key-package exhaustion

Summary

Fixes WPB-27396 by recovering MLS conversations that may have missed Welcome messages while the client had no available key packages.

Changes

  • Detect when the backend MLS key-package count reaches zero.
  • Refill key packages and persist an account-scoped recovery marker in Core DB.
  • Refresh the complete conversation list to discover conversations created during key-package exhaustion.
  • Audit active MLS and mixed-protocol conversations in batches of 10.
  • Rejoin locally missing MLS groups using the existing external-commit flow.
  • Track pending conversation IDs so interrupted recovery resumes with the remaining conversations.
  • Retry recovery after startup, reconnect, window focus, or returning to the foreground.
  • Pause recovery while the application is inactive.
  • Continue processing after individual conversation failures and retain recovery state for another attempt.
  • Clear recovery state only after the entire audit completes successfully.

Tests

Added coverage for:

  • Zero key-package detection and successful refill.
  • Normal low-count refills that should not trigger recovery.
  • Upload and persistence failures.
  • Recovery across application restarts.
  • Pending-conversation progress tracking.
  • MLS and mixed-protocol conversation recovery.
  • Skipping Proteus, past-member, and already-established conversations.
  • Pausing in the background and continuing after individual failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant