refactor: Uses withReporting to force named functions for tracing (#21219)

This commit is contained in:
Omar López authored and GitHub committed 2025-05-12 13:22:52 -04:00
1 parent 79d695236f
commit b3d3cb1dee
35 files changed
+853 -393

No files matched your search

+3 -5
View File
@@ -18,7 +18,7 @@ import type { FormResponse } from "@calcom/app-store/routing-forms/types/types";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
import { isAuthorizedToViewFormOnOrgDomain } from "@calcom/features/routing-forms/lib/isAuthorizedToViewForm";
import logger from "@calcom/lib/logger";
import monitorCallbackAsync from "@calcom/lib/sentryWrapper";
import { withReporting } from "@calcom/lib/sentryWrapper";
import { RoutingFormRepository } from "@calcom/lib/server/repository/routingForm";
import { UserRepository } from "@calcom/lib/server/repository/user";
@@ -36,10 +36,6 @@ function hasEmbedPath(pathWithQuery: string) {
return onlyPath.endsWith("/embed") || onlyPath.endsWith("/embed/");
}
export const getRoutedUrl = (context: Pick<GetServerSidePropsContext, "query" | "req">) => {
return monitorCallbackAsync(_getRoutedUrl, context);
};
const _getRoutedUrl = async (context: Pick<GetServerSidePropsContext, "query" | "req">) => {
const queryParsed = querySchema.safeParse(context.query);
const isEmbed = hasEmbedPath(context.req.url || "");
@@ -221,3 +217,5 @@ const _getRoutedUrl = async (context: Pick<GetServerSidePropsContext, "query" |
},
};
};
export const getRoutedUrl = withReporting(_getRoutedUrl, "getRoutedUrl");
+7 -1
View File
@@ -1,6 +1,7 @@
import { Prisma } from "@prisma/client";
import type { FormResponse } from "@calcom/app-store/routing-forms/types/types";
import { withReporting } from "@calcom/lib/sentryWrapper";
import prisma, { bookingMinimalSelect } from "@calcom/prisma";
import type { Booking } from "@calcom/prisma/client";
import { BookingStatus } from "@calcom/prisma/enums";
@@ -165,7 +166,7 @@ export class BookingRepository {
});
}
static async findAllExistingBookingsForEventTypeBetween({
private static async _findAllExistingBookingsForEventTypeBetween({
eventTypeId,
seatedEvent = false,
startDate,
@@ -277,6 +278,11 @@ export class BookingRepository {
return [...resultOne, ...resultTwoWithOrganizersRemoved, ...resultThree];
}
static findAllExistingBookingsForEventTypeBetween = withReporting(
BookingRepository._findAllExistingBookingsForEventTypeBetween,
"findAllExistingBookingsForEventTypeBetween"
);
static async getAllBookingsForRoundRobin({
users,
eventTypeId,