feat: prevent adminless group [WPB-25246]#21364
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #21364 +/- ##
==========================================
+ Coverage 45.83% 45.87% +0.04%
==========================================
Files 1698 1703 +5
Lines 43840 43943 +103
Branches 9127 9146 +19
==========================================
+ Hits 20092 20159 +67
- Misses 21472 21502 +30
- Partials 2276 2282 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
🔗 Download Full Report Artifact 🧪 Playwright Test Summary
|
| ).length; | ||
| const isLastAdmin = isSelfAdmin && otherAdminCount === 0; | ||
|
|
||
| if (isLastAdmin) { |
There was a problem hiding this comment.
Please add tests for "last admin leaves" branches: eligible users, no eligible users, and self-exclusion case.
There was a problem hiding this comment.
I planned to add them in next PR as this PR is already huge.
I will add in this PR.
|
This change introduces new branching behavior in leaveConversation plus a new modal/store flow, but I don’t see corresponding tests. Please add tests for:
This is a high-risk path (permissions + destructive actions), so deterministic tests are needed before merge |
|



Summary
This PR introduces a safeguard for cases where the last admin of a group attempts to leave, ensuring groups are never left without an admin.
Changes Included
Added a new
LeaveGroupAdminModalAdded Zustand-based modal state management
Implemented
AdminSearchInputAdded supporting styles and utilities
Integrated modal into existing leave-group flow
Added new i18n strings
Result
Prevents groups from being left without an admin and improves the overall group management experience.