Skip to content

feat: date range overhaul#9802

Merged
PeerRich merged 88 commits intomainfrom
feature/date-range-overhaul
Jul 5, 2023
Merged

feat: date range overhaul#9802
PeerRich merged 88 commits intomainfrom
feature/date-range-overhaul

Conversation

@emrysal
Copy link
Copy Markdown
Contributor

@emrysal emrysal commented Jun 26, 2023

Would like 3 approvals before merge 🙏

What does this PR do?

Rewrites slot/availability logic by using date ranges. It simplifies the code, it was really tricky to make fixes in the old logic. It also fixes the issue that date overrides in different timezones didn't adjust, resulting in the organizer being booked outside their availability. All existing tests are passing + added new tests for the new logic

How should it be tested?

  • check if all test pass with yarn test
  • check if the available slots shown for an event are correct with different combinations of event type settings and time zones:
    • organizer and attendee timezones
    • working hours
    • date overrides
    • event type setting (min booking notice, buffers, event duration, etc.)

Fixes that date overrides were not adjusted to different timezones:
Fixes #8666
Fixes #8374
Fixes #8329
Fixes #8000
Fixes #7687
Fixes #7114

emrysal and others added 30 commits May 9, 2023 10:08
@PeerRich PeerRich removed the request for review from roae July 3, 2023 14:57
alannnc
alannnc previously approved these changes Jul 3, 2023
Copy link
Copy Markdown
Contributor

@alannnc alannnc left a comment

Choose a reason for hiding this comment

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

Working fine and also with slots.

leog
leog previously approved these changes Jul 3, 2023
Copy link
Copy Markdown
Contributor

@leog leog left a comment

Choose a reason for hiding this comment

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

Tested a bunch of availability and time zones, as well as different event types courtesy of our pro user. Tests passed too.

zomars
zomars previously approved these changes Jul 4, 2023
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

LGTM

@hariombalhara
Copy link
Copy Markdown
Member

I am seeing these 2 failures locally when running tests.
Screenshot 2023-07-04 at 9 33 05 AM

@CarinaWolli
Copy link
Copy Markdown
Member

CarinaWolli commented Jul 4, 2023

I am seeing these 2 failures locally when running tests.

@hariombalhara What's your system time zone?

@hariombalhara
Copy link
Copy Markdown
Member

IST

Comment on lines +395 to +405
`04:15:00.000Z`,
`05:00:00.000Z`,
`05:45:00.000Z`,
`06:30:00.000Z`,
`07:15:00.000Z`,
`08:00:00.000Z`,
`08:45:00.000Z`,
`09:30:00.000Z`,
`10:15:00.000Z`,
`11:00:00.000Z`,
`11:45:00.000Z`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the reason for this time shift by 30mins? Was it a bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So we used to block out the slots for the duration of the slots - so if there was a 10m meeting at 4:15 and the event length was 45m - the next open slot would be 5:00. We've now changed this, so it will open up the nearest :15 - so 4:30 will open up again instead of 5:00.

@PeerRich
Copy link
Copy Markdown
Member

PeerRich commented Jul 4, 2023

this has two approvals. should I merge? We can do a follow up PR for NITs

@hariombalhara
Copy link
Copy Markdown
Member

hariombalhara commented Jul 4, 2023

Created the bookings(133-136) in the order shown below in prisma studio
Screenshot 2023-07-04 at 5 41 28 PM

I was then able to make a booking (with ID 137) for the time that was already booked(See 135).

Not sure if it's important but I used three different events (15min, 30min, 60min).
Also, organizer timezone was PKT and booking was done in IST.

hariombalhara
hariombalhara previously approved these changes Jul 5, 2023
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

LGTM !! Let's finish those double bookings

zomars
zomars previously approved these changes Jul 5, 2023
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Let's go!

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 Urgent Created by Linear-GitHub Sync

Projects

None yet

8 participants