feat: dist tracing 4 (#25574)
* feat: distributed tracing 2 * feat: distributed tracing 2 * refactor: feedback * refactor: feedback * fix: type error * fix: trpc error * feat: distributed tracing - 3 * chore: translation * refactor: improvements * fix: feedback * chore: remove * feat: dist tracing 4 * fix: type errors * fix: type errors * fix: remove string type * fix: type errors
This commit is contained in:
1 parent
0d4108dd69
commit
4e1d05a7e7
15 files changed
+127
-26
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
import { describe, it, beforeEach, vi, expect } from "vitest";
|
||||
|
||||
import * as handleConfirmationModule from "@calcom/features/bookings/lib/handleConfirmation";
|
||||
import { distributedTracing } from "@calcom/lib/tracing/factory";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
import { confirmHandler } from "@calcom/trpc/server/routers/viewer/bookings/confirm.handler";
|
||||
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
|
||||
@@ -92,6 +93,7 @@ describe("confirmHandler", () => {
|
||||
timeZone: organizer.timeZone,
|
||||
username: organizer.username,
|
||||
} as NonNullable<TrpcSessionUser>,
|
||||
traceContext: distributedTracing.createTrace("test_confirm_handler"),
|
||||
};
|
||||
|
||||
const res = await confirmHandler({
|
||||
|
||||
@@ -10,6 +10,7 @@ import type { z } from "zod";
|
||||
|
||||
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
|
||||
import { handleStripePaymentSuccess } from "@calcom/features/ee/payments/api/webhook";
|
||||
import { distributedTracing } from "@calcom/lib/tracing/factory";
|
||||
import { ProfileRepository } from "@calcom/features/profile/repositories/ProfileRepository";
|
||||
import { weekdayToWeekIndex, type WeekDays } from "@calcom/lib/dayjs";
|
||||
import type { HttpError } from "@calcom/lib/http-error";
|
||||
@@ -2287,7 +2288,8 @@ export function getMockedStripePaymentEvent({ paymentIntentId }: { paymentIntent
|
||||
export async function mockPaymentSuccessWebhookFromStripe({ externalId }: { externalId: string }) {
|
||||
let webhookResponse = null;
|
||||
try {
|
||||
await handleStripePaymentSuccess(getMockedStripePaymentEvent({ paymentIntentId: externalId }));
|
||||
const traceContext = distributedTracing.createTrace("test_stripe_webhook");
|
||||
await handleStripePaymentSuccess(getMockedStripePaymentEvent({ paymentIntentId: externalId }), traceContext);
|
||||
} catch (e) {
|
||||
log.silly("mockPaymentSuccessWebhookFromStripe:catch", JSON.stringify(e));
|
||||
webhookResponse = e as HttpError;
|
||||
|
||||
Reference in new issue
Block a user