cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

fix: Change filters to correctly get the right bookingCounts

Open emrysal opened this issue 1 year ago • 2 comments

What does this PR do?

Drafting with self-review so it becomes clear what happened.

TODO: This needs tests (interplay of different filters) TODO: Create safety net to re-open slots when no slots are found due to filters.

bookingCounts returned the booking counts of all hosts but also increased the count of other hosts if the checked host was an attendee on his Booking. This could decrease the minBookingCount considerably (as this may only happen once) - this was the root cause of the issue; but it would only be triggered if the host that was attended by the other checked host was also being checked.

This triggered "No available slots" when the host that suddenly was included was an old host (part of eventType.hosts, but no longer part of the team) as that old host would then be chosen as qualified host, as he was so far behind the other hosts and then result 0 slots because he wasn’t part of the routedMemberIds

emrysal avatar Nov 26 '24 17:11 emrysal

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2024 8:52pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2024 8:52pm

vercel[bot] avatar Nov 26 '24 18:11 vercel[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 13 '24 00:12 github-actions[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jan 27 '25 00:01 github-actions[bot]

This logic has been deprecated (and replaced by shared code)

emrysal avatar Mar 10 '25 01:03 emrysal