From f9b1d454bc85b23433d47a28e1ff566407c07c57 Mon Sep 17 00:00:00 2001 From: Christophe Vila Date: Mon, 27 Jul 2026 10:34:57 +0200 Subject: [PATCH] fix(frontend): dedupe identical banners in banner.ts Multiple independent requests that fail with the same message (e.g. Activities.tsx's mount effect firing loadFirstPage/listWorkoutKinds/getProfile separately) each call showError() independently, previously stacking 2-3 textually-identical banners for a single root cause (backend down, brief network blip). show() now skips adding a banner if one with the same severity+message is already visible, and skips scheduling a redundant auto-dismiss timer for it -- the original banner's timer keeps running untouched. --- frontend/src/banner.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/banner.ts b/frontend/src/banner.ts index e34e240..1c6d63b 100644 --- a/frontend/src/banner.ts +++ b/frontend/src/banner.ts @@ -17,6 +17,11 @@ function notify() { } function show(severity: BannerSeverity, message: string): void { + const isDuplicate = banners.some( + (b) => b.severity === severity && b.message === message, + ); + if (isDuplicate) return; + const id = nextId++; banners = [{ id, severity, message }, ...banners]; notify();