Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushEventTo(this.el, ...) sends event to live view instead of target live component in rare case. #3622

Open
rapidfsub opened this issue Jan 10, 2025 · 1 comment

Comments

@rapidfsub
Copy link

Environment

  • Elixir version (elixir -v): Elixir 1.18.1 (compiled with Erlang/OTP 27)
  • Phoenix version (mix deps): 1.7.18
  • Phoenix LiveView version (mix deps): 2.0.4
  • Operating system: Debian GNU/Linux 12 (bookworm)·Kernel: 6.6.69-fly·x86_64(server), client(maybe windows)
  • Browsers you attempted to reproduce this bug on (the more the merrier): chrome(maybe)
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: I don't know.

Actual behavior

We encountered the following backtrace twice in our production server. Unfortunately, I cannot reproduce the issue locally or in staging environments, so this report is based solely on the production logs.

Backtrace:

lib/**/*_live.ex **Live.handle_event("...")
lib/phoenix_live_view/channel.ex:508 anonymous fn/3 in Phoenix.LiveView.Channel.view_handle_event/3
/app/deps/telemetry/src/telemetry.erl:324 :telemetry.span/3
lib/phoenix_live_view/channel.ex:260 Phoenix.LiveView.Channel.handle_info/2
gen_server.erl:2345 :gen_server.try_handle_info/3
gen_server.erl:2433 :gen_server.handle_msg/6
proc_lib.erl:329 :proc_lib.init_p_do_apply/3

Observations:

The event that triggered this issue was intended to be sent to a live component but was instead handled by the parent live view.

Under normal circumstances, this event is sent correctly to the live component, and the functionality works as expected.

This anomaly happened only twice in production, with no identifiable pattern.

No additional context or logs were captured at the time, and I regret that further debugging information is unavailable.

Expected behavior

The event should consistently be sent to the intended live component, as it does under normal operation.

This is a simple bug report due to the lack of reproducibility and detailed debugging information. If you have suggestions for additional diagnostics or logging that could help identify the root cause, please let me know so I can implement them in production to capture more data if this happens again.

@SteffenDE
Copy link
Collaborator

@rapidfsub which LiveView version are you running?

Phoenix LiveView version (mix deps): 2.0.4

The newest one is 1.0.2, so do you mean 0.20.4? If yes, please try to reproduce this on the most recent one and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants