Repository navigation
Commit ac3315b
fix(communities): settle leave edges after the relay has answered
Follow-up to Leave community in the rail menu (ca92ffe), addressing the
review's three warnings and three suggestions.
- A relay that answers "blocked: you are banned from this community" has
already severed access at authentication, before any leave handler
runs, so no retry could ever succeed. `requestLeave` now resolves it as
`access-revoked` alongside `already-absent` (both via a new
`settledRefusal()` in the shared protocol module), and the rail removes
the community from this device with an informational toast saying
access was revoked, instead of keeping a membership the viewer could
never remove.
- Failures before and after the relay accepted the leave read
differently. A pre-publish failure keeps the connection-oriented retry
message. Once `requestLeave` has resolved, a failing `communities.leave`
reports that the community was left but this device couldn't finish
cleaning up, and that leaving it again finishes (through the
not-a-member answer). To keep that promise accurate, the service's
required save is now the only step that throws, before anything
changes; a session that will not dispose is reported rather than
thrown, since the membership is already gone by then.
- When the left community was the selected one, the rail routes the
fallback to Personal space through the host's `onSelect` callback after
the service has updated the store, so the leave gets the same channels
navigation and ingress-recovery check as clicking Personal space and
the viewer is not left on a Settings card scoped to a gone community.
- After leaving an inactive community, focus follows the selection: the
still-selected community's button, or Personal space only where a left
selection actually landed. Focus still returns to the community itself
after a cancel or a failure that kept it.
- Purge failures are no longer discarded. `purgeCommunityDeviceState`
names each store, logs every failure with `console.warn` including the
store and origin, and `communities.leave` returns the list so the rail
appends "Some saved data couldn't be cleared." to the success toast
when any occurred.
- Removing a session scope guards the `indexOf` result, so a miss can
never splice another community's scope off the teardown list.
Tests: the rail test gains the banned answer in the settled-refusal
table, a post-publish device failure that shows the cleanup message and
not the connection one, host selection of Personal space for a left
selection (and none for an inactive one), the residual-data toast line,
and the inactive-leave case now expects focus on the still-selected
community. The device-state and service tests assert the named,
console-warned failures; the native adapter test covers the banned
classification. Each new or adjusted test was checked to fail against
the previous sources. The communities and shell docs describe the
settled answers, the two failure messages, the host-routed fallback and
focus placement.
Typecheck, lint and the full unit suite (421 files, 5132 tests) pass.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>1 parent ca92ffe commit ac3315b
11 files changed
Lines changed: 360 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
| 147 | + | |
| 148 | + | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
| |||
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
| 157 | + | |
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
| |||
547 | 558 | | |
548 | 559 | | |
549 | 560 | | |
| 561 | + | |
550 | 562 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
555 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
556 | 616 | | |
557 | 617 | | |
558 | 618 | | |
| |||
628 | 688 | | |
629 | 689 | | |
630 | 690 | | |
| 691 | + | |
| 692 | + | |
631 | 693 | | |
632 | | - | |
633 | | - | |
634 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
635 | 727 | | |
636 | 728 | | |
637 | | - | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
638 | 732 | | |
639 | | - | |
| 733 | + | |
640 | 734 | | |
641 | 735 | | |
642 | 736 | | |
643 | | - | |
| 737 | + | |
644 | 738 | | |
645 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
646 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
647 | 767 | | |
648 | 768 | | |
649 | 769 | | |
650 | 770 | | |
651 | 771 | | |
652 | | - | |
653 | 772 | | |
654 | 773 | | |
655 | 774 | | |
| |||
0 commit comments