-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
Environment
- Elixir version (elixir -v): 1.14
- Phoenix version (mix deps): 1.7.21
- Phoenix LiveView version (mix deps): 1.0.17
- Operating system: macOS 26.0.1
- Browsers you attempted to reproduce this bug on (the more the merrier): chrome
- Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes
Actual behavior
When switching from one LiveView to another under artificially increased network latency, LiveView continues to send events from the previous LiveView to the server. Once the new LiveView mounts, those old events no longer exist and Phoenix logs no route or event not found errors.
This results in LiveView trying to handle events on the wrong socket/view.
Expected behavior
When navigating to a new LiveView, any events queued for the previous LiveView should be dropped or ignored.
The new LiveView should not receive events belonging to the previous one, regardless of latency.
An app that reproduces the behavior
https://github.com/adamzaninovich/liveview-messaging-bug-demo