-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: missing external users validation on members tab #37071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: f26895c The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds client-side validation and accessibility wiring to the Members tab Add Users flow: prevents selecting external users when the current room is non-federated, surfaces a localized FieldError linked via useId, and adds a changeset entry for a patch release. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant UI as Members Tab (AddUsers)
participant Validator as Client Validation
participant Server as Room API
User->>UI: Pick users to add
UI->>Validator: Evaluate room.isFederated + selected users
alt Non-federated room & external users detected
Validator-->>UI: Return validation error
UI-->>User: Show inline FieldError (aria-describedby) and block submit
else No external users or room is federated
UI->>Server: Submit add-users request
Server-->>UI: Success / Failure
UI-->>User: Present result
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37071 +/- ##
===========================================
+ Coverage 67.37% 67.39% +0.02%
===========================================
Files 3326 3328 +2
Lines 113207 113360 +153
Branches 20535 20571 +36
===========================================
+ Hits 76268 76396 +128
- Misses 34338 34359 +21
- Partials 2601 2605 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.changeset/two-owls-flow.md (1)
5-5: Fix grammar in changeset summaryTiny nit: switch to “an external user” for smoother wording.
Apply this diff to adjust the sentence:
-Prevents adding a external user to a non federated room through Members tab +Prevents adding an external user to a non federated room through Members tabapps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx (1)
26-27: Default the users array before validatingReact Hook Form can call a validator with
undefined(e.g., before the field is registered or if the autocomplete clears by emittingundefined). In that casehasExternalUserswill throw on.some. Giving the helper a default[]keeps the check safe while preserving behavior.Apply this diff to guard against undefined inputs:
-const hasExternalUsers = (users: string[]): boolean => users.some((user) => user.startsWith('@')); +const hasExternalUsers = (users: string[] = []): boolean => users.some((user) => user.startsWith('@'));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.changeset/two-owls-flow.md(1 hunks)apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx(5 hunks)
apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx
Outdated
Show resolved
Hide resolved
dougfabris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
FDR-164
Proposed changes (including videos or screenshots)
Prevent adding external users to a non federated room through Members tab
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Bug Fixes
New Features