Skip to content

Recover pending encrypted chat membership after reconnect - #231

Draft
dmitryvm1 wants to merge 1 commit into
TinyComms:mainfrom
dmitryvm1:fix/encrypted-membership-reconnect
Draft

dmitryvm1 wants to merge 1 commit into
TinyComms:mainfrom
dmitryvm1:fix/encrypted-membership-reconnect

Conversation

@dmitryvm1

Copy link
Copy Markdown
Contributor

What changed and why

An encrypted chat can remain stuck with a signed, uncommitted device addition when its existing member misses the live handshake event while offline. Returning online now starts background membership catch-up after the conversation list loads and after socket resume, allowing admission to finish without sending a message first.

Concurrent catch-up requests share one worker per device. Successful sync requests a message backfill so messages can become readable after the device joins.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/encrypted-membership-reconnect

Lab run: Pending. The scenario documents the required real-app startup and socket-resume runs; platform UI drivers and base/branch recordings are not implemented yet. This PR remains draft and does not claim e2e-proof.

Validation completed locally:

  • The focused regression exercises real MLS devices through conversation-list publication: a returning creator commits a missed Add, the recipient accepts its Welcome, and the recipient's first message decrypts on the creator.
  • That regression fails behaviorally with the original list-refresh implementation and passes with the fix.
  • cargo test --locked -p chatd --lib adapters::tiny::: 246 passed, 9 ignored.
  • git diff --check: passed.

Compatibility

No protocol changes or server deployment required. Existing membership APIs are reused, including bounded retries for older servers that batch changes. An existing member still needs to connect for an admission to complete.

Risk and rollback

Startup and reconnection cause additional membership reads and possible commits for known encrypted conversations. Workers are coalesced per device and retain the existing bounded retry schedule. Revert this commit to restore the previous event-driven behavior.

Release note

Finish pending encrypted-chat device additions automatically after startup or reconnection.

Revisit known encrypted conversations after list publication and socket resume so missed handshake events do not leave device additions uncommitted. Coalesce membership catch-up workers and backfill messages after successful sync.

Add a regression covering offline admission and document the required recorded app scenario. Verified that the regression fails with the original list-refresh code; the Tiny adapter suite passes with 246 tests passed and 9 ignored. Full recorded platform proof remains pending.
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