Closed KrisJordan closed 4 months ago
Huh. Interesting. I'll take a look right away!
I'll add you as admin on XL site so you can see the XL Ambassadors view there, as well
I can reproduce in dev, as well, on main
branch
Yeah! I'm not sure how that slipped by. I'm working on this right now. I think I may have an idea as to why this might be happening
I'm probably about to call it a night in the next 15, but I will be up pretty early and can merge/deploy then. If you can't find it quick, just pick it back up tomorrow don't lose sleep over it.
We are successfully blocking reservations that overlap, so no real danger just potentially annoyance in the short term if someone tries to reserve something that's already been reserved.
Thanks for jumping on this!
Huh. This is really weird. I opened this up on local host and sure enough encounter the same problem. However, I changed the time back to around 11 am just to check whether this was something to do with operating hours spanning between two days since it's almost midnight.
Turns out that if I set my local date & time on my device to 11 am or any time within the 10 am to 6 pm duration, everything seems to work fine. However there is something strange happening after hours... really weird
It has to be in one of the couple of relevant method lines modified here, right: https://github.com/unc-csxl/csxl.unc.edu/commit/b29e7f68b1f6575fd623d709d5d19a7d7f9ddedc
Without my loading up the full logic, I wonder if your described symptoms map to these logical changes in an interesting way. Given some logic seems relative to "current time" it feels likely to be here.
After midnight, it's now working in prod for today and tomorrow. This is a fun bug :) It seems perhaps related to following the close of operating hours on a given day?
Since it's plausibly working until 7pm tomorrow/today now, we can pick back up tomorrow! Thanks again for moving quickly.
(realizing my operating hours theory likely isn't it because after reset demo we should be open, maybe it's the 23rd hour of the day...)
It appears to be working fine now that it is 12AM so it does seem to only be present between the end of operating hours and midnight.
Welp. I figured out the issue. This was the saddest bug ever.
if date.date() == current_time.date():
if end_idx < current_time_idx:
continue
start_idx = max(current_time_idx, start_idx)
Just had to add in the condition for date.date() == current_time.date() to make sure I was not skipping over reservations when end_idx < current_time_idx for reservations in the future :/
Step to reproduce:
Two reservations I created showing in backend:
Also showing in my coworking home:
Not showing in the new reservation screen: