Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/app-store/locations.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* TODO: Consolidate this file with BookingLocationService and add tests
*/
import type { TFunction } from "i18next";
import { z } from "zod";

Expand Down Expand Up @@ -58,7 +61,7 @@ export type EventLocationTypeFromApp = Ensure<
export type EventLocationType = DefaultEventLocationType | EventLocationTypeFromApp;

export const DailyLocationType = "integrations:daily";

export const CalVideoLocationType = DailyLocationType;
export const MeetLocationType = "integrations:google:meet";

export const MSTeamsLocationType = "integrations:office365_video";
Expand Down Expand Up @@ -380,7 +383,7 @@ export const getLocationValueForDB = (
eventLocations: LocationObject[]
) => {
let bookingLocation = bookingLocationTypeOrValue;
let conferenceCredentialId = undefined;
let conferenceCredentialId: number | undefined = undefined;

eventLocations.forEach((location) => {
if (location.type === bookingLocationTypeOrValue) {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/webex/api/add.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextApiRequest } from "next";
import { stringify } from "querystring";

import { WEBAPP_URL } from "@calcom/lib/constants";
import { WEBAPP_URL_FOR_OAUTH } from "@calcom/lib/constants";
import { defaultHandler } from "@calcom/lib/server/defaultHandler";
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import prisma from "@calcom/prisma";
Expand All @@ -26,7 +26,7 @@ async function handler(req: NextApiRequest) {
const params = {
response_type: "code",
client_id,
redirect_uri: `${WEBAPP_URL}/api/integrations/${config.slug}/callback`,
redirect_uri: `${WEBAPP_URL_FOR_OAUTH}/api/integrations/${config.slug}/callback`,
scope: "spark:kms meeting:schedules_read meeting:schedules_write", //should be "A space-separated list of scopes being requested by your integration"
state: "",
};
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/webex/api/callback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NextApiRequest, NextApiResponse } from "next";

import { WEBAPP_URL } from "@calcom/lib/constants";
import { WEBAPP_URL_FOR_OAUTH } from "@calcom/lib/constants";
import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";
import prisma from "@calcom/prisma";

Expand All @@ -17,7 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

/** @link https://developer.webex.com/docs/integrations#getting-an-access-token **/

const redirectUri = encodeURI(`${WEBAPP_URL}/api/integrations/${config.slug}/callback`);
const redirectUri = encodeURI(`${WEBAPP_URL_FOR_OAUTH}/api/integrations/${config.slug}/callback`);
const params = new URLSearchParams([
["grant_type", "authorization_code"],
["client_id", client_id],
Expand Down
13 changes: 12 additions & 1 deletion packages/features/ee/round-robin/handleRescheduleEventManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,24 @@ export const handleRescheduleEventManager = async ({

const results = updateManager.results ?? [];

const calVideoResult = results.find((result) => result.type === "daily_video");
// Check if Cal Video Creation Failed - That is the fallback for Cal.com and is expected to always work
if (calVideoResult && !calVideoResult.success) {
handleRescheduleEventManager.error("Cal Video creation failed", {
error: calVideoResult.error,
bookingLocation,
});
// This happens only when Cal Video is down
throw new Error("Failed to set video conferencing link, but the meeting has been rescheduled");
}

const { metadata: videoMetadata, videoCallUrl: _videoCallUrl } = getVideoCallDetails({
results: results,
});

let videoCallUrl = _videoCallUrl;
let metadata: AdditionalInformation = {};
metadata = videoMetadata;

if (results.length) {
// Handle Google Meet results
if (bookingLocation === MeetLocationType) {
Expand Down Expand Up @@ -154,6 +164,7 @@ export const handleRescheduleEventManager = async ({
? calendarResult?.updatedEvent[0]?.iCalUID
: calendarResult?.updatedEvent?.iCalUID || undefined;
}

const newReferencesToCreate = structuredClone(updateManager.referencesToCreate);

await BookingReferenceRepository.replaceBookingReferences({
Expand Down
Loading
Loading