Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
createLiveToastHookinstalls three global listeners for each toast, but they remain registered after the hook is destroyed. A laterphx:clear-flashevent can therefore callpushEventon an old view and reject withunable to push hook event. LiveView not connected; dismissal callbacks also retain removed toast instances.Change
clear-flashandlive-toast-dismissthrough the native hookhandleEventAPI, so LiveView removes those listeners during hook cleanup.flash-leaveon the toast element rather thanwindow, preserving the target check and animation.flash-leave.mix assets.build, as required byAGENTS.md.No error suppression, connection guards, dependency updates, or public API changes. This addresses listener lifetime, not cancellation of already-running async callbacks.
Validation
cd assets && bun test: 12 passed, 0 failed.cd assets && bun run typecheck: passed.mix assets.build: passed; inspected all generated formats. Both maps embed the current canonical source and have no local machine paths.mix format: passed, with no unrelated formatting changes.cd demo && mix test: 30 passed.git diff --check: passed.Local validation used Bun 1.4.2 and Elixir 1.20.4 / OTP 29.1.1. The existing dependency lockfiles were unchanged; older locked Elixir dependencies emitted compatibility/deprecation warnings on this runtime.