{"record":{"id":"26ab1920a22224a2","repo":"calcom/cal.diy","slug":"could-not-install-google-meet","errorCode":null,"errorMessage":"Could not install Google Meet","messagePattern":"Could not install Google Meet","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-store/_utils/useAddAppMutation.ts","lineNumber":65,"sourceCode":"      let type: string | null | undefined;\n      const teamId = variables && variables.teamId ? variables.teamId : undefined;\n      const defaultInstall = variables && variables.defaultInstall ? variables.defaultInstall : undefined;\n      const returnTo = options?.returnTo\n        ? options.returnTo\n        : variables && variables.returnTo\n        ? variables.returnTo\n        : undefined;\n      if (variables === \"\") {\n        type = _type;\n      } else {\n        type = variables.type;\n      }\n      if (type?.endsWith(\"_other_calendar\")) {\n        type = type.split(\"_other_calendar\")[0];\n      }\n\n      if (options?.installGoogleVideo && type !== \"google_calendar\")\n        throw new Error(\"Could not install Google Meet\");\n\n      const state: IntegrationOAuthCallbackState = {\n        onErrorReturnTo,\n        fromApp: true,\n        ...(teamId && { teamId }),\n        ...(type === \"google_calendar\" && { installGoogleVideo: options?.installGoogleVideo }),\n        ...(returnTo && { returnTo }),\n        ...(defaultInstall && { defaultInstall }),\n      };\n\n      const stateStr = JSON.stringify(state);\n      const searchParams = generateSearchParamString({\n        stateStr,\n        teamId,\n        returnTo,\n      });\n\n      const res = await fetch(`/api/integrations/${type}/add${searchParams}`);","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/_utils/useAddAppMutation.ts#L47-L83","documentation":"Thrown by the useAddAppMutation React Query mutation when options.installGoogleVideo is true but the app 'type' being installed is not 'google_calendar'. Google Meet video is installed as a side-effect of connecting a Google Calendar account, so the hook rejects attempts to attach it to any other integration (e.g. outlook_calendar, or an '_other_calendar' variant). It is a synchronous throw inside mutationFn, so it surfaces in the mutation's error state rather than over the network.","triggerScenarios":"Calling mutate({ type: 'outlook_calendar' }) while the hook was created with installGoogleVideo: true; selecting a non-Google calendar in the install UI while the 'also install Google Meet' toggle is on; an '_other_calendar' variant that splits to a non-google base type.","commonSituations":"Multi-calendar install dropdown where the Meet checkbox stays enabled after switching providers; default-install flow passing the wrong app type; stale UI state after the user changes their calendar selection.","solutions":["Only set installGoogleVideo: true when the selected integration type is 'google_calendar'.","Disable/toggle off the Google Meet checkbox whenever a non-Google calendar is selected.","If Google Meet is genuinely required, install a google_calendar credential first.","Pass the resolved type through the same control that sets installGoogleVideo so they cannot disagree."],"exampleFix":"// before\nconst mutation = useAddAppMutation(null, { installGoogleVideo: meetEnabled });\nmutation.mutate({ type: selectedType }); // throws if selectedType !== 'google_calendar'\n\n// after\nconst mutation = useAddAppMutation(null, {\n  installGoogleVideo: meetEnabled && selectedType === 'google_calendar',\n});\nmutation.mutate({ type: selectedType });","handlingStrategy":"validation","validationCode":"const canInstallMeet = (type: string | null | undefined) =>\n  !meetEnabled || type === 'google_calendar';\nif (!canInstallMeet(selectedType)) {\n  // do not call mutate; warn the user instead\n}","typeGuard":"const isGoogleCalendar = (type: unknown): type is 'google_calendar' =>\n  type === 'google_calendar';","tryCatchPattern":"// React Query onError receives this sync throw\nmutation.mutate(vars, {\n  onError: (err) => {\n    if (err.message === 'Could not install Google Meet') {\n      setMeetEnabled(false); // auto-correct the toggle\n    }\n  },\n});","preventionTips":["Bind the Meet toggle's enabled state to selectedType === 'google_calendar'.","Disable the install button when installGoogleVideo and type disagree.","Strip the '_other_calendar' suffix before evaluating the Meet precondition."],"tags":["react-query","google-meet","integration","client-side","validation"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}