Commit 4f26338
fix: relay confirmation before merge and welcome (MIP-02/MIP-03)
Rewrite add_member_device and remove_member_device to defer
merge_pending_commit until after relay confirmation, matching
MDK's documented ordering requirement.
Before: merge locally → fire-and-forget publish → send welcomes
After: create commit → return immediately → background: relay
publish with retries → merge → send welcomes → UI update
The Tauri command returns immediately (no UX blocking). A new
publish_event_with_retries helper provides 5-attempt exponential
backoff matching pika core's pattern.
This prevents permanent group state divergence when all relays
reject the commit, and ensures welcomes reference a commit that
is actually available on relays (MIP-02).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent a8bb6bf commit 4f26338
3 files changed
Lines changed: 344 additions & 160 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
657 | | - | |
| 656 | + | |
658 | 657 | | |
659 | 658 | | |
660 | 659 | | |
| |||
681 | 680 | | |
682 | 681 | | |
683 | 682 | | |
684 | | - | |
685 | | - | |
| 683 | + | |
686 | 684 | | |
687 | 685 | | |
688 | 686 | | |
| |||
0 commit comments