{"record":{"id":"e6d465a42bc22ca5","repo":"calcom/cal.diy","slug":"default-conferencing-app-not-set-e6d465","errorCode":null,"errorMessage":"Default conferencing app not set","messagePattern":"Default conferencing app not set","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-store/_utils/bulkUpdateTeamEventsToDefaultLocation.ts","lineNumber":24,"sourceCode":"\nexport const bulkUpdateTeamEventsToDefaultLocation = async ({\n  eventTypeIds,\n  teamId,\n  prisma,\n}: {\n  eventTypeIds: number[];\n  teamId: number;\n  prisma: PrismaClient;\n}) => {\n  const team = await prisma.team.findUnique({\n    where: { id: teamId },\n    select: { metadata: true },\n  });\n  const metadataResult = teamMetadataSchema.safeParse(team?.metadata);\n  const defaultApp = metadataResult.success ? metadataResult.data?.defaultConferencingApp : null;\n\n  if (!defaultApp) {\n    throw new Error(\"Default conferencing app not set\");\n  }\n\n  const foundApp = getAppFromSlug(defaultApp.appSlug);\n  const appType = foundApp?.appData?.location?.type;\n  if (!appType) {\n    throw new Error(`Default conferencing app '${defaultApp.appSlug}' doesnt exist.`);\n  }\n\n  const credential = await prisma.credential.findFirst({\n    where: {\n      teamId,\n      appId: foundApp.slug,\n    },\n    select: {\n      id: true,\n    },\n  });\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/_utils/bulkUpdateTeamEventsToDefaultLocation.ts#L6-L42","documentation":"Thrown by bulkUpdateTeamEventsToDefaultLocation when the team's metadata (parsed via teamMetadataSchema) has no defaultConferencingApp. This is the team-level analogue of the user bulk update: it applies a default conferencing location to team event types and requires a team default conferencing app to be configured first.","triggerScenarios":"Calling bulkUpdateTeamEventsToDefaultLocation for a team whose metadata.defaultConferencingApp is unset, null, or failed schema parsing (metadataResult.success is false). Triggered by a team admin action before the team has a default conferencing app.","commonSituations":"Team admin clicks 'apply default location to all team events' without configuring the team's default conferencing app; team metadata is null or malformed; a new team with no metadata yet.","solutions":["Have a team admin set the team's default conferencing app in team settings before the bulk action.","Guard the caller: parse team metadata and skip/prompt when defaultConferencingApp is missing.","Repair malformed team metadata if safeParse is failing."],"exampleFix":"// before\nawait bulkUpdateTeamEventsToDefaultLocation({ eventTypeIds, teamId, prisma });\n// after\nconst team = await prisma.team.findUnique({ where: { id: teamId }, select: { metadata: true } });\nconst parsed = teamMetadataSchema.safeParse(team?.metadata);\nif (!parsed.success || !parsed.data?.defaultConferencingApp) {\n  return res.status(400).json({ message: 'Team has no default conferencing app' });\n}","handlingStrategy":"validation","validationCode":"import { teamMetadata as teamMetadataSchema } from '@calcom/prisma/zod-utils';\nconst parsed = teamMetadataSchema.safeParse(team?.metadata);\nif (!parsed.success || !parsed.data?.defaultConferencingApp) {\n  return res.status(400).json({ message: 'Team has no default conferencing app' });\n}","typeGuard":"function teamHasDefaultConferencingApp(metadata: unknown): boolean {\n  const parsed = teamMetadataSchema.safeParse(metadata);\n  return !!parsed.success && !!parsed.data?.defaultConferencingApp;\n}","tryCatchPattern":"null","preventionTips":["Require a team admin to set a default conferencing app before exposing the bulk action.","Validate team metadata before calling bulkUpdateTeamEventsToDefaultLocation.","Repair malformed team metadata so safeParse succeeds."],"tags":["event-types","conferencing","team","metadata","validation"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}