mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-27 08:25:50 +00:00
## Summary Debounce the reconnecting toast with a 1.5s grace period so brief WebSocket blips don't flash a persistent error banner. ## Problem After #9543 made all error toasts sticky (no auto-dismiss), brief WebSocket disconnections (<1s) would show a persistent "Reconnecting..." error banner that stays until the `reconnected` event fires. On staging, users see this banner even though jobs are actively executing. ## Changes - Extract reconnection toast logic from `GraphView.vue` into `useReconnectingNotification` composable - Add 1.5s delay (via `useTimeoutFn` from VueUse) before showing the reconnecting toast - If `reconnected` fires within the delay window, suppress both the error and success toasts entirely - Clean up unused `useToast`/`useI18n` imports from `GraphView.vue` ## Testing - Sub-1.5s disconnections: no toast shown - Longer disconnections (>1.5s): error toast shown, cleared with success toast on reconnect - Setting `Comfy.Toast.DisableReconnectingToast`: no toasts shown at all - Multiple rapid `reconnecting` events: only one toast shown 6 unit tests covering all scenarios. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10997-fix-debounce-reconnecting-toast-to-prevent-false-positive-banner-33d6d73d3650810289e8f57c046972f1) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>