calcom/cal.diy · error · Error

Default conferencing app not set

Error message

Default conferencing app not set

What it means

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.

Source

Thrown at packages/app-store/_utils/bulkUpdateEventsToDefaultLocation.ts:23

import type { LocationObject } from "../locations";
import { getAppFromSlug } from "../utils";
import { filterEventTypesWhereLocationUpdateIsAllowed } from "./getBulkEventTypes";

type PrismaLike = Pick<PrismaClient, "credential" | "eventType">;

export const bulkUpdateEventsToDefaultLocation = async ({
  eventTypeIds,
  user,
  prisma,
}: {
  eventTypeIds: number[];
  user: Pick<User, "id" | "metadata">;
  prisma: PrismaLike;
}) => {
  const defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;

  if (!defaultApp) {
    throw new Error("Default conferencing app not set");
  }

  const foundApp = getAppFromSlug(defaultApp.appSlug);
  const appType = foundApp?.appData?.location?.type;
  if (!appType) {
    throw new Error(`Default conferencing app '${defaultApp.appSlug}' doesnt exist.`);
  }

  const credential = await prisma.credential.findFirst({
    where: {
      userId: user.id,
      appId: foundApp.slug,
    },
    select: {
      id: true,
    },
  });

View on GitHub (pinned to 176037d0af)

Solutions

  1. Have the user set a default conferencing app in their profile/settings before invoking the bulk update.
  2. Guard the caller: read userMetadata.defaultConferencingApp and skip or prompt the user if absent.
  3. If metadata is stale after a schema migration, re-save the user's conferencing preferences.

Example fix

// before - calling bulk update unconditionally
await bulkUpdateEventsToDefaultLocation({ eventTypeIds, user, prisma });
// after - check the precondition
const defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;
if (!defaultApp) {
  return res.status(400).json({ message: 'Set a default conferencing app first' });
}
await bulkUpdateEventsToDefaultLocation({ eventTypeIds, user, prisma });
Defensive patterns

Strategy: validation

Validate before calling

import { userMetadata as userMetadataSchema } from '@calcom/prisma/zod-utils';
const defaultApp = userMetadataSchema.parse(user.metadata)?.defaultConferencingApp;
if (!defaultApp) {
  return res.status(400).json({ message: 'Set a default conferencing app first' });
}

Type guard

function hasDefaultConferencingApp(metadata: unknown): boolean {
  const parsed = userMetadataSchema.safeParse(metadata);
  return !!parsed.success && !!parsed.data?.defaultConferencingApp;
}

Try / catch

null

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/8a3c011b2e56f330. Report an issue: GitHub.