{"record":{"id":"8a3c011b2e56f330","repo":"calcom/cal.diy","slug":"default-conferencing-app-not-set","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/bulkUpdateEventsToDefaultLocation.ts","lineNumber":23,"sourceCode":"import type { LocationObject } from \"../locations\";\nimport { getAppFromSlug } from \"../utils\";\nimport { filterEventTypesWhereLocationUpdateIsAllowed } from \"./getBulkEventTypes\";\n\ntype PrismaLike = Pick<PrismaClient, \"credential\" | \"eventType\">;\n\nexport const bulkUpdateEventsToDefaultLocation = async ({\n  eventTypeIds,\n  user,\n  prisma,\n}: {\n  eventTypeIds: number[];\n  user: Pick<User, \"id\" | \"metadata\">;\n  prisma: PrismaLike;\n}) => {\n  const defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;\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      userId: user.id,\n      appId: foundApp.slug,\n    },\n    select: {\n      id: true,\n    },\n  });\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/_utils/bulkUpdateEventsToDefaultLocation.ts#L5-L41","documentation":"Thrown by bulkUpdateEventsToDefaultLocation when user.metadata (parsed via userMetadataSchema) has no defaultConferencingApp. The function bulk-applies a default conferencing location to many event types, so it requires the user to have chosen a default conferencing app first. Without it there is nothing to apply.","triggerScenarios":"Calling bulkUpdateEventsToDefaultLocation for a user whose metadata.defaultConferencingApp is unset or null. Typically triggered from a UI action ('set all events to my default app') before the user has configured a default conferencing app in settings.","commonSituations":"User clicked 'apply default location to all events' without first selecting a default conferencing app; metadata field name changed/migrated; a freshly created user with empty metadata triggering the bulk action.","solutions":["Have the user set a default conferencing app in their profile/settings before invoking the bulk update.","Guard the caller: read userMetadata.defaultConferencingApp and skip or prompt the user if absent.","If metadata is stale after a schema migration, re-save the user's conferencing preferences."],"exampleFix":"// before - calling bulk update unconditionally\nawait bulkUpdateEventsToDefaultLocation({ eventTypeIds, user, prisma });\n// after - check the precondition\nconst defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;\nif (!defaultApp) {\n  return res.status(400).json({ message: 'Set a default conferencing app first' });\n}\nawait bulkUpdateEventsToDefaultLocation({ eventTypeIds, user, prisma });","handlingStrategy":"validation","validationCode":"import { userMetadata as userMetadataSchema } from '@calcom/prisma/zod-utils';\nconst defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;\nif (!defaultApp) {\n  return res.status(400).json({ message: 'Set a default conferencing app first' });\n}","typeGuard":"function hasDefaultConferencingApp(metadata: unknown): boolean {\n  const parsed = userMetadataSchema.safeParse(metadata);\n  return !!parsed.success && !!parsed.data?.defaultConferencingApp;\n}","tryCatchPattern":"null","preventionTips":["Check user.metadata.defaultConferencingApp before offering the bulk-update action in the UI.","Prompt users to choose a default conferencing app in settings.","Handle the absence gracefully instead of letting the function throw."],"tags":["event-types","conferencing","metadata","validation"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}