Repository navigation
Conversation
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.
itz4blitz
left a comment
There was a problem hiding this comment.
Reviewed as a draft; this is what I'd want fixed before it is marked ready.
The fix itself looks right. Nudging from publish and from the non-fresh resume path covers the missed-handshake case. The per-device flag with the drop guard resets correctly, including when the thread spawn fails. CI is green on all three OSes plus package and pr-gate. The in-process MLS regression is a good test.
Changes I'd like:
-
The scenario can't run.
e2e/scenarios/encrypted-membership-reconnecthas only a README and scenario.json. Every other scenario hasdrive.pyplus the per-OSdrive.*scripts. The gate wants a scenario that drives the real app and fails on main. The lab has nothing to execute here, so there is noe2e-proofto wait for. Please add at least the drivers for the platforms the lab can record today (linux, windows, android), or say plainly which ones are deferred. -
publishalso runs on OpenSpace/OpenHome (messages.rs ~353), so moving around the UI now starts a sync of every known encrypted conversation, then two more passes at 35s and 40s. The flag stops overlap, but it can still repeat about every 75s. Consider nudging only from the ready/resume paths, or rate-limiting it. -
known_encrypted()also includes conversations from stalecache-*.logfiles. Those will now log awarn!on each of the 3 passes if the sync fails (deleted or left rooms). Keep it atdebugor only warn on unexpected errors. -
Small: the test sleeps against a 5s wall clock and uses the global
devices()registry. It's fine now, but worth a drop guard so a failed assert doesn't leave entries behind.
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 startup conversation list loads and after socket ready/resume, allowing admission to finish without sending a message first.
Concurrent catch-up requests share one worker per device. UI navigation does not start catch-up. Successful sync requests a message backfill so messages can become readable after the device joins. Failed background syncs log at debug because cached groups may refer to deleted or left rooms.
Type
Platforms
Proof
Scenario: e2e/scenarios/encrypted-membership-reconnect
Lab run: Deferred. Linux, Windows and Android drivers are not implemented despite those lab platforms being able to record today. macOS and iOS drivers are also deferred, with the lab blockers documented in e2e/README.md. The scenario README lists the missing driver and recording for each platform. This PR remains draft: there is nothing for the lab to execute yet, and no e2e-proof or quality-gate completion is claimed.
Validation completed locally:
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 socket ready/resume 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.