fix: use SDK DailyFatalErrorType, add meeting-full/not-allowed/exp-token cases, remove dead end_date fallback

This commit is contained in:
Igor Loskutov
2026-02-05 19:43:25 -05:00
parent 4fd88b2fc1
commit d3161730ef
2 changed files with 38 additions and 10 deletions

View File

@@ -83,9 +83,6 @@ def _should_sync(room) -> bool:
return time_since_sync.total_seconds() >= room.ics_fetch_interval
MEETING_DEFAULT_DURATION = timedelta(hours=1)
async def create_upcoming_meetings_for_event(
event: CalendarEvent, create_window: datetime, room: Room
):
@@ -98,7 +95,7 @@ async def create_upcoming_meetings_for_event(
# Prevent duplicate meetings from aggregated calendar feeds
# (e.g. same event appears with different UIDs from Cal.com and Google Calendar)
end_date = event.end_time or (event.start_time + MEETING_DEFAULT_DURATION)
end_date = event.end_time
existing_by_time = await meetings_controller.get_by_room_and_time_window(
room, event.start_time, end_date
)

View File

@@ -17,6 +17,7 @@ import DailyIframe, {
DailyCustomTrayButtons,
DailyEventObjectCustomButtonClick,
DailyEventObjectFatalError,
DailyFatalErrorType,
DailyFactoryOptions,
DailyParticipantsObject,
} from "@daily-co/daily-js";
@@ -97,6 +98,41 @@ function FatalErrorScreen({
</VStack>
</Center>
);
case "meeting-full":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">This meeting is full.</Text>
<Button onClick={() => router.push(`/${roomName}`)}>
Back to Room
</Button>
</VStack>
</Center>
);
case "not-allowed":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">
You are not allowed to join this meeting.
</Text>
<Button onClick={() => router.push(`/${roomName}`)}>
Back to Room
</Button>
</VStack>
</Center>
);
case "exp-token":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">Your session has expired.</Text>
<Button onClick={() => window.location.reload()}>
Try Rejoining
</Button>
</VStack>
</Center>
);
default:
return (
<Center width="100vw" height="100vh">
@@ -148,12 +184,7 @@ const USE_FRAME_INIT_STATE = {
joined: false as boolean,
} as const;
type DailyFatalErrorType =
| "connection-error"
| "exp-room"
| "ejected"
| (string & {});
type FatalError = { type: DailyFatalErrorType; message: string };
type FatalError = { type: DailyFatalErrorType | "unknown"; message: string };
// Daily js and not Daily react used right now because daily-js allows for prebuild interface vs. -react is customizable but has no nice defaults
const useFrame = (