Repository navigation
Accept booking slots that fall on the next UTC date of the schedule window - #1904
Open
jayhemnani9910 wants to merge 1 commit into
Open
jayhemnani9910 wants to merge 1 commit into
jayhemnani9910 wants to merge 1 commit into
Conversation
|
[Medium impact] The PR appears safe to merge. SummaryFixes booking checks for working hours that cross midnight UTC or shift across UTC dates after daylight saving changes.
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "Accept booking slots that fall on the ne..." · Reviewed by Greptile |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed?
is_this_a_valid_booking_timenow checks the slot against the schedule windows starting the day before, on, and the day after the slot's UTC date, in both the default and the custom-availability branch. Addedtest_slot_on_next_utc_dateandtest_window_saved_before_dst_startsintest/unit/test_utils.py.Implementation assisted by Claude Code. I reproduced the bug, reviewed the change and checked the tests.
Why?
The schedule's times are stored in UTC, and the check built the window from the slot's UTC date. When a local working day crosses midnight UTC (9:00–17:00 in Sydney is 22:00–06:00 UTC), slots on the second UTC date were compared with the following day's window and rejected as too early, although the booking page offers them. In Sydney 11:00–16:00 couldn't be booked; in Los Angeles the 16:00 slot. A DST change since the schedule was saved can shift the window by another day (16:00–20:00 saved in January in Los Angeles: the 16:00 PDT slot in July).
Limitations and Notes
The window is checked for three days because the stored UTC times alone (plus the offset at save time) don't say which UTC date the local day starts on.
Applicable Issues
Closes #1903
QA Log
test_slot_on_next_utc_date: Sydney 00:00Z and 05:00Z slots accepted, 06:00Z and 21:00Z rejected; Los Angeles 00:00Z accepted, 01:00Z rejected. The accepted cases fail without the change.Tools.available_slots_from_scheduleoffers for every day of 2027 across 14 timezones, 7 local windows (saved in January and July) and custom availabilities, and validated each: main rejects 119,654 of 505,764 offered slots, this change none; scanning every UTC quarter hour, no slot validates that isn't offered.pytest: 491 passed;TestDnsCaldavLookup::test_for_txt_record(DNS) andtest_disable_enable_subscriberfail the same way on main here.ruff checkandruff format --checkclean.