Skip to content

fix(points-card): track and clear toast auto-hide timer (ERR-4)#587

Merged
tempus2016 merged 1 commit into
mainfrom
fix/err4-points-toast-timer
Jun 25, 2026
Merged

fix(points-card): track and clear toast auto-hide timer (ERR-4)#587
tempus2016 merged 1 commit into
mainfrom
fix/err4-points-toast-timer

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

ERR-4 — points-card toast setTimeout leak

The 3s notification auto-hide timer had no stored handle and was never cleared, so removing the card within 3s fired requestUpdate() on a detached element, and rapid actions stacked untracked timers (an older one could clear a newer toast early). The handle is now stored, cleared on re-trigger and in disconnectedCallback.

Testing

Verified on ha-dev via browserless: the timer is set when a toast shows, cleared on disconnect, and there are zero console errors past the 3s window.

From AUDIT_REPORT.md §3.2.

The 3s notification dismiss timer had no stored handle and was never
cleared, so removing the card within 3s fired requestUpdate() on a
detached element, and rapid actions stacked untracked timers (an older
one could clear a newer toast early). Store the handle, clear it on
re-trigger and in disconnectedCallback.

Verified on ha-dev via browserless: timer is set on toast, cleared on
disconnect, zero console errors past the 3s window.
@github-actions github-actions Bot added the cards Lovelace cards / frontend (www/*.js) label Jun 25, 2026
@tempus2016 tempus2016 merged commit e9917f6 into main Jun 25, 2026
10 checks passed
@tempus2016 tempus2016 deleted the fix/err4-points-toast-timer branch June 25, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cards Lovelace cards / frontend (www/*.js)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant