cal.com
cal.com copied to clipboard
[CAL-736] Collective events are ignored from getBusyTimes booking query
Issue Summary
In getBusyTimes.ts - conflicting bookings are found based on userId, this does not work on a Collective event as there is no single user assigned, so other event types remain bookable when there is no calendar connected.
const busyTimes: EventBusyDetails[] = await prisma.booking
.findMany({
where: {
userId,
startTime: { gte: new Date(startTime) },
endTime: { lte: new Date(endTime) },
status: {
in: [BookingStatus.ACCEPTED],
},
},
select: {
id: true,
startTime: true,
endTime: true,
title: true,
eventType: {
select: {
id: true,
afterEventBuffer: true,
beforeEventBuffer: true,
},
},
},
})
From SyncLinear.com | CAL-736
@emrysal do you wanna look into it? you have some experience with getBusyTimes
@PeerRich I'm investigating this one
nice!
feel free to book cal.com/emrysal if you have questions
@PeerRich @emrysal would you mind guiding me on how to create a Collective event? I've done the following:
-
yarn dx
and logged into the[email protected]
- Created a new Team (with
[email protected]
as the only member) - In an incognito browser, I open the Team link
From there I see a list of the team's individual members, which I gather does not create a Collective event, but an event for that specific user. I also tried booking an event with multiple attendees, which didn't reproduce the bug either.
What's the best way to create a Collective event?
Thanks π
From the event type page you can create a team event type, in which you can choose Collective or Round Robin.

Also you can use the [email protected] account
@emrysal Sorry for my dumbness here, but I'm still struggling to recreate this issue. I've done the following:
- Completely reset my local db by running
yarn db-nuke
from withinpackages/prisma
- Booted the app locally with
yarn dx
- Logged into
[email protected]
- Created a new Event Type for Team Pro the individual user (the seeded data doesn't have this by default)
- Confirmed in the new Event Type that Team Pro is shown as available for a given time slot (ex: Feb 6 @ 8am)
- Edited the Seeded Team's "Collective Seeded Team Event" > Assignment > added Team Pro as the only team member > Save
- Opened the public url for "Collective Seeded Team Event" and scheduled an event for Feb 6 @ 8am
- Confirmed this new event shows up under Bookings
- Opened the Team Pro user public URL, and the Feb 6 @ 8am time slot is no longer available
Can you help me understand what I'm missing? I'll schedule some time to discuss, but your next availability isn't until tomorrow (my time) so I'd love to be unblocked sooner than that π
Maybe @PeerRich you could confirm whether this bug is still present, or I'm just misunderstanding the best way to recreate it?
this could be one of those hard to debug calendar bugs. welcome to Cal.com! π€£
@emrysal sorry we weren't able to meet, feel free to reschedule for another time if you like.
@PeerRich I'm going to move on from this ticket for now until someone can give me guidance on reliably reproducing it π
@AaronPresley apologies, I never got the event added to my calendar (even though my google integration seems fine) - re-connected google so I don't miss bookings going forward.
I'll reschedule.
@emrysal no worries! I noticed you booked the meeting for Feb 13, 10 days from now. Was that intentional? I'm also available Monday the 6th. Otherwise see you on the 13th π
It wasn't; thanks for the heads up
One thing of note I can think of right now that may cause your collective event to show up is if you are the owner, it won't show up if you are not, have you tried the collective event as a non-owner?
- Create the event type as teampro
- Assign to the collective event [email protected]
- Make the booking as any external user, not [email protected]
- See if the collective event is marked as busy
@emrysal thanks for the chat today, and the above edit. I'm now able to recreate the bug locally π