From 120e318cc71cc186994ae77760fa01ad734653a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 21 May 2026 23:05:44 +0200 Subject: [PATCH] feat(settings): wire warning pill state for persistent Withings failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit W4 added a 'warning' state to IntegrationStatusPill plus locale copy ('Verbunden, aber Serverfehler') for the v1.4.42 persistent FailureKind (Withings 601 / 293 / 294), but the wave's allow-list excluded integrations-section.tsx. The pill state existed as dead code. Wire pillStateFor to return 'warning' when the integration's state is error_transient AND the consecutive persistent-bucket count is > 0, so a user clicking reconnect ten times on an upstream contract mismatch finally sees a different signal. v1.4.43 W10 high-reconcile — product-lead PL-H1, design H1, simplifier H-1. --- .../settings/integrations-section.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/settings/integrations-section.tsx b/src/components/settings/integrations-section.tsx index a58a66151..ed8e8575e 100644 --- a/src/components/settings/integrations-section.tsx +++ b/src/components/settings/integrations-section.tsx @@ -74,6 +74,11 @@ interface IntegrationStatusViewModel { lastAttemptAt: string | null; lastError: string | null; consecutiveFailures: number; + consecutiveFailuresByKind?: { + transient: number; + reauth_required: number; + persistent: number; + } | null; configured?: boolean; connected?: boolean; connectedAt?: string | null; @@ -132,6 +137,18 @@ function pillStateFor( case "connected": return "connected"; case "error_transient": + // v1.4.43 W4 H3 — a `persistent` failure-kind streak (Withings + // rate-limit 601 / contract-mismatch 293/294) maps to the same + // `error_transient` DB state as a normal retryable failure but + // tells the user a different story: the access token still + // works, the upstream is responding with a non-recoverable + // status. Surfacing it as a "warning" pill (orange) instead of + // the red "Fehler — neu verbinden" stops the user from clicking + // reconnect ten times when reconnect can't fix it. + if ((status.consecutiveFailuresByKind?.persistent ?? 0) > 0) { + return "warning"; + } + return "error"; case "error_reauth": return "error"; case "parked":