fix: gracefully handle calendar failures when bypassBusyCalendarTimes is enabled (#23061)
* fix: gracefully handle calendar failures when bypassBusyCalendarTimes is enabled - When _bypassCalendarBusyTimes parameter is true and third-party calendar fetching fails - System now falls back to internal bookings only instead of throwing error - Maintains existing error behavior when bypass is disabled Co-Authored-By: [email protected] <[email protected]> * feat: add _silentCalendarFailures parameter to handle calendar failures gracefully - Add silentlyHandleCalendarFailures parameter to getBusyTimes service - Add _silentCalendarFailures parameter to getUserAvailability schema - Add _silentCalendarFailures parameter to tRPC slots endpoint - Add _silentCalendarFailures parameter to API v2 slots/available endpoint - Parameter attempts calendar calls first, falls back silently on failure - Different from bypassCalendarBusyTimes which skips calendar calls entirely Co-Authored-By: [email protected] <[email protected]> * refactor: remove bypassBusyCalendarTimes logic from error handling - Keep only silentlyHandleCalendarFailures logic in getBusyTimes error handling - Remove redundant bypassBusyCalendarTimes condition from calendar failure handling - Maintain existing bypassBusyCalendarTimes logic that skips calendar calls entirely Co-Authored-By: [email protected] <[email protected]> * feat: add silentlyHandleCalendarFailures prop to Booker atom - Pass silentlyHandleCalendarFailures prop from BookerPlatformWrapper to useAvailableSlots - Forward prop as _silentCalendarFailures parameter to API v2 slots/available endpoint - Complete the parameter flow from Booker atom to underlying service layer - Enables silent handling of calendar provider failures in Booker component Co-Authored-By: [email protected] <[email protected]> * chore: fix type and bump library * chore: bump library --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Somay Chauhan <[email protected]> Co-authored-by: Morgan <[email protected]>
This commit is contained in:
11 files changed
+102
-302
No files matched your search
@@ -64,6 +64,7 @@ const BookerPlatformWrapperComponent = (
|
||||
onTimeslotsLoaded,
|
||||
startTime: customStartTime,
|
||||
showNoAvailabilityDialog,
|
||||
silentlyHandleCalendarFailures = false,
|
||||
} = props;
|
||||
const layout = BookerLayouts[view];
|
||||
|
||||
@@ -310,6 +311,7 @@ const BookerPlatformWrapperComponent = (
|
||||
Boolean(event?.data?.id),
|
||||
orgSlug: props.entity?.orgSlug ?? undefined,
|
||||
eventTypeSlug: isDynamic ? "dynamic" : eventSlug || "",
|
||||
_silentCalendarFailures: silentlyHandleCalendarFailures,
|
||||
...routingParams,
|
||||
});
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
|
||||
onTimeslotsLoaded?: (slots: Record<string, Slot[]>) => void;
|
||||
startTime?: string | Date;
|
||||
roundRobinHideOrgAndTeam?: boolean;
|
||||
silentlyHandleCalendarFailures?: boolean;
|
||||
};
|
||||
|
||||
type VIEW_TYPE = keyof typeof BookerLayouts;
|
||||
|
||||
@@ -136,6 +136,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
|
||||
: { username: props.calUsername })}
|
||||
hostsLimit={3}
|
||||
allowUpdatingUrlParams={true}
|
||||
silentlyHandleCalendarFailures={false}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -194,6 +194,12 @@ export class GetAvailableSlotsInput_2024_04_15 {
|
||||
@ApiHideProperty()
|
||||
_bypassCalendarBusyTimes?: boolean;
|
||||
|
||||
@Transform(({ value }) => value && value.toLowerCase() === "true")
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@ApiHideProperty()
|
||||
_silentCalendarFailures?: boolean;
|
||||
|
||||
@Transform(({ value }) => (value ? value.toLowerCase() === "true" : false))
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
|
||||
Reference in new issue
Block a user