Review

Checkout form breadcrumbs leak card PAN into Sentry

Wire Sentry into the valet parking checkout flow so we can debug flaky Stripe tokenization failures. Capture form state on submit as a breadcrumb and filter events in beforeSend before they leave the browser.

SentryTier 3sentrypiibreadcrumbspci

Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.

apps/valet-web/src/observability/sentry.ts+24-0
11import * as Sentry from "@sentry/react";
22import { BrowserTracing } from "@sentry/tracing";
33
4+type TipFormSnapshot = {
5+ plate: string;
6+ tipCents: number;
7+ cardNumber: string;
8+ exp: string;
9+ cvc: string;
10+};
11+
12+export function captureCheckoutAttempt(form: TipFormSnapshot) {
13+ Sentry.addBreadcrumb({
14+ category: "checkout.tip",
15+ message: "Submitting tip for plate " + form.plate,
16+ level: "info",
17+ data: form,
18+ });
19+}
20+
421export function initSentry() {
522 Sentry.init({
623 dsn: import.meta.env.VITE_SENTRY_DSN,
724 integrations: [new BrowserTracing()],
25+ beforeSend(event) {
26+ // Drop noisy network noise from the kiosk wifi probe
27+ if (event.message?.includes("wifi-probe")) {
28+ return null;
29+ }
30+ return event;
31+ },
832 tracesSampleRate: 0.2,
933 });
1034}