From 7a78085a49ee367780baf9055d208cc34655d4fd Mon Sep 17 00:00:00 2001 From: Konsti Wohlwend Date: Wed, 8 Jul 2026 09:26:17 -0700 Subject: [PATCH] Preserve the caught error in the billing-degradation error boundaries (#1741) --- .../projects/[projectId]/analytics/shared.tsx | 14 +++++++------- .../[projectId]/auth-methods/page-client.tsx | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/shared.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/shared.tsx index 3addac8a2..f140a9144 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/shared.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/analytics/shared.tsx @@ -333,16 +333,16 @@ export function ErrorDisplay({ error, onRetry }: { error: unknown, onRetry: () = * error escape to the page. `Suspense` keeps the banner from blocking the page * while its data loads. */ -function BillingBannerErrorFallback() { +function BillingBannerErrorFallback({ location, error }: { location: string, error: unknown }) { useEffect(() => { - captureError("analytics-limit-banner:billing-read-failed", new Error("Failed to load plan-limit banner data; hiding the banner")); - }, []); + captureError(location, error); + }, [location, error]); return null; } -function ResilientBillingBanner(props: { children: ReactNode }) { +function ResilientBillingBanner(props: { children: ReactNode, location: string }) { return ( - + }> {props.children} @@ -356,7 +356,7 @@ function ResilientBillingBanner(props: { children: ReactNode }) { */ export function AnalyticsEventLimitBanner() { return ( - + ); @@ -387,7 +387,7 @@ function AnalyticsEventLimitBannerContent() { */ export function SessionReplayLimitBanner() { return ( - + ); diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx index 31dcc50d4..26362cd17 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx @@ -199,7 +199,7 @@ function AddCustomOidcButton({ onClick }: { onClick: () => void }) { // read failure (or while it loads) we report it and fall back to the locked // (non-Team) state, which is the same safe default as having no owner team. return ( - }> + }> }> @@ -207,10 +207,10 @@ function AddCustomOidcButton({ onClick }: { onClick: () => void }) { ); } -function AddCustomOidcButtonPlanReadFailed({ onClick }: { onClick: () => void }) { +function AddCustomOidcButtonPlanReadFailed({ onClick, error }: { onClick: () => void, error: unknown }) { useEffect(() => { - captureError("auth-methods:custom-oidc-plan-gate", new Error("Failed to load owner team plan for the custom OIDC gate; defaulting to locked")); - }, []); + captureError("auth-methods:custom-oidc-plan-gate", error); + }, [error]); return ; }