Skip to content

Conversation

@hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Jan 14, 2026

What does this PR do?

Fixes a bug where the UI shows team members who match segment criteria even when they don't have host entries in the database. When assignAllTeamMembers is true and segment filtering is enabled, members would appear in the Assignment tab but wouldn't actually be assigned during booking because they lack host entries.

The Problem:

  • The filtering logic in EditWeightsForAllTeamMembers short-circuited when assignAllTeamMembers was true, showing all segment-matching members regardless of whether they had host entries
  • The handleSave function only updates hosts that already exist in the value array, filtering out members without host entries
  • This created a misleading UI where members appeared but wouldn't be assigned

The Fix:

  • Removed the assignAllTeamMembers prop from EditWeightsForAllTeamMembers component entirely since the filtering should always check for existing host entries
  • Updated the filter in EditWeightsForAllTeamMembers.tsx to always check for existing host entries in the value array
  • Added filterMemberIds prop to Segment component to filter matching team members to only show those who are hosts of the event-type
  • AddMembersWithSwitch now passes the list of non-fixed host user IDs to the Segment component via filterMemberIds

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a team event type with round-robin scheduling
  2. Enable "Assign all team members" toggle
  3. Enable segment filtering with criteria that matches some team members
  4. Verify that only members who have host entries (are actually assigned to the event type) appear in the "Edit team member weights" sheet
  5. Members matching segment criteria but without host entries should NOT be displayed

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Human Review Checklist

  • Verify the filtering logic correctly shows only members with host entries in both EditWeightsForAllTeamMembers and Segment components
  • Confirm this aligns with the actual booking behavior (members without host entries won't be assigned)
  • Check that filterMemberIds prop is correctly passed through AddMembersWithSwitchMembersSegmentWithToggleSegmentMatchingTeamMembers
  • Verify the filter value.filter((host) => !host.isFixed).map((host) => host.userId) correctly extracts non-fixed host IDs

Link to Devin run: https://app.devin.ai/sessions/3333b41226d0452e98ef7ac358511f5b
Requested by: @hariombalhara

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…bersWithSegmentPlatform` and remove the `assignAllTeamMembers` prop from `EditWeightsForAllTeamMembers`.
@pull-request-size pull-request-size bot added size/L and removed size/S labels Jan 19, 2026
devin-ai-integration bot and others added 3 commits January 19, 2026 07:22
…ponent and pass a dynamic list of member IDs from AddMembersWithSwitch
…f github.com:calcom/cal.com into devin/filter-segment-members-host-entries-1768366489
@hariombalhara hariombalhara marked this pull request as ready for review January 19, 2026 08:36
@graphite-app graphite-app bot added the enterprise area: enterprise, audit log, organisation, SAML, SSO label Jan 19, 2026
@graphite-app graphite-app bot requested a review from a team January 19, 2026 08:36
@graphite-app graphite-app bot added the core area: core, team members only label Jan 19, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not a huge fan of how hosts are loaded into the event type settings pages so I think we should reconsider how this works later.

Copy link
Member Author

hariombalhara commented Jan 20, 2026

Merge activity

  • Jan 20, 1:31 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 20, 1:31 AM UTC: @hariombalhara merged this pull request with Graphite.

@hariombalhara hariombalhara merged commit 38a7fcf into main Jan 20, 2026
83 of 84 checks passed
@hariombalhara hariombalhara deleted the devin/filter-segment-members-host-entries-1768366489 branch January 20, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants