From 569a389e84320a8036a2545f3f656f3123bd08f9 Mon Sep 17 00:00:00 2001 From: Paul Albrecht Date: Wed, 9 Sep 2026 21:27:34 +0200 Subject: [PATCH] fix(dynamic-booking): respect username order when picking the conferencing app (#30124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first member of a dynamic group decides which conferencing app the group booking uses. getPublicEvent read users[0] straight from findUsersByUsername, which does not guarantee the order given in the URL, so /alice+bob could end up using bob's preference — or fall back to Cal Video when only alice has one set. handleNewBooking already sorts by the dynamic user list for this exact reason (sortUsersByDynamicList in getLocationValuesForDb.ts). Applying the same order here keeps the advertised location and the booked location in sync. --- packages/features/eventtypes/lib/getPublicEvent.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/features/eventtypes/lib/getPublicEvent.ts b/packages/features/eventtypes/lib/getPublicEvent.ts index 467755ebd9..2ff2bb7162 100644 --- a/packages/features/eventtypes/lib/getPublicEvent.ts +++ b/packages/features/eventtypes/lib/getPublicEvent.ts @@ -299,7 +299,15 @@ export const getPublicEvent = async ( usernameList, orgSlug: org, }); - const users = usersInOrgContext; + // The first member of a dynamic group decides which conferencing app is used, so the order + // given in the URL has to win here. findUsersByUsername does not guarantee that order, which + // means /alice+bob could pick bob's preference. handleNewBooking already sorts for exactly + // this reason (sortUsersByDynamicList in getLocationValuesForDb.ts) — without the same sort + // here, the booking page can advertise a different location than the one actually booked. + const users = [...usersInOrgContext].sort( + (a, b) => + usernameList.indexOf(a.username ?? "") - usernameList.indexOf(b.username ?? "") + ); const defaultEvent = getDefaultEvent(eventSlug); let locations = defaultEvent.locations ? (defaultEvent.locations as LocationObject[]) : [];