You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: merge working hours when adjacent (calcom#21912)
* fix: Adjacency issue when working hours connect over multiple days
* Add tests to validate the new merging of day end logic
* Update to correct annotation.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Implement subsequent date ranges for date overrides also
* The map needs to be updated on successful resolve.
* test: add failing test for overlapping ranges with same end time
Demonstrates bug where overlapping working hour ranges (6:00-10:00 and 8:00-10:00)
lose the earlier portion (6:00-8:00), showing only 8:00 and 9:00 slots
instead of all 4 slots (6:00, 7:00, 8:00, 9:00).
Related to Carina's comment on PR calcom#21912.
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
* fix: properly merge overlapping ranges with same end time
Fixes bug where overlapping working hour ranges with the same end time
(e.g., 6:00-10:00 and 8:00-10:00) would lose the earlier portion of the
first range. The merging logic now correctly preserves the earliest
start time when ranges overlap and share the same end time.
This ensures all expected time slots are available (6:00, 7:00, 8:00, 9:00)
instead of losing the earlier slots (6:00, 7:00).
Resolves the issue identified in Carina's comment on PR calcom#21912.
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
* perf: optimize overlapping range detection from O(n²) to O(n)
Replaces Object.keys().find() with Map-based lookup for ranges with same end time.
This optimization handles 2000+ date ranges efficiently, reducing complexity from
4M operations to linear time while maintaining the same merging behavior.
Performance improvement for high-volume event types with many availability ranges.
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0 commit comments