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

Fix #4318 fix getBusyTimes to factor in all users from collective bookings

Open isaiahdahl opened this issue 1 year ago • 6 comments

What does this PR do?

This PR changes the query for bookings in getBusyTimes.ts to look for all bookings where the user is attached to the event, instead of just bookings where the user is the organizer.

Fixes # 4318

Environment: Staging(main branch) / Production

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] Chore (refactoring code, technical debt, workflow improvements)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How should this be tested?

It's a pretty simple change, I verified it by deploying it to my self-hosted instance and checking that the time slot that wasn't being blocked off for a user is now being blocked off.

The issue that I initially had is now resolved for me.

Checklist

isaiahdahl avatar Sep 08 '22 22:09 isaiahdahl

@isaiahdahl is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 08 '22 22:09 vercel[bot]

Ahh yes of course. Ok I'll adjust.

isaiahdahl avatar Sep 09 '22 15:09 isaiahdahl

@emrysal I pushed an update, pulled code from packages/trpc/server/routers/viewer/booking.tsx

Are you able to confirm that when it's a round robin event type, the person who gets booked or selected will be the userId on the booking? Not just the user who created the round robin event?

I still think this code would be right but if it's not updating the userId on the booking when it's round robin, maybe it should be.

isaiahdahl avatar Sep 09 '22 16:09 isaiahdahl

hey @isaiahdahl can you update your branch? it seems like we can't: CleanShot 2022-09-10 at 17 53 14@2x

PeerRich avatar Sep 10 '22 15:09 PeerRich

@PeerRich yup, done.

isaiahdahl avatar Sep 10 '22 17:09 isaiahdahl

@PeerRich or @emrysal Is there anything else I can do to get this merged? I keep pressing the update branch button but it doesn't take long before it's out of date again.

isaiahdahl avatar Sep 14 '22 20:09 isaiahdahl

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

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Oct 6, 2022 at 7:19PM (UTC)

vercel[bot] avatar Oct 06 '22 19:10 vercel[bot]

Is this PR still relevant? Or should we close it? @isaiahdahl

alannnc avatar Nov 01 '22 01:11 alannnc

@alannnc Yes, it's still relevant. I tried keeping the branch up to date for a while but then no one was taking a look at it so I stopped.

isaiahdahl avatar Nov 01 '22 14:11 isaiahdahl