flame_on icon indicating copy to clipboard operation
flame_on copied to clipboard

Support LiveView 0.18.X

Open davydog187 opened this issue 2 years ago • 4 comments

Hello and thanks for the great project!

This issue is to track support for the latest release of phoenix_live_view, 0.18.18.

Currently, it is incompatible

Because your app depends on flame_on ~> 0.2 which depends on phoenix_live_view ~> 0.17.6, phoenix_live_view ~> 0.17.6 is required.
So, because your app depends on phoenix_live_view ~> 0.18.3, version solving failed.

davydog187 avatar Apr 17 '23 21:04 davydog187

@davydog187 we do have support for LV 0.18 in main, however #26 is a real issue that I have not yet been able to resolve and was hoping to figure out before cutting an official hex release. Could you try main in your project and let me know if you run into the same issue outlined in #26? Either way if you could report your findings in that issue, it would be greatly appreciated.

TheFirstAvenger avatar Apr 21 '23 16:04 TheFirstAvenger

@TheFirstAvenger appreciate it! I'll give it a run as soon as I can and report back

davydog187 avatar Apr 26 '23 23:04 davydog187

@TheFirstAvenger I was able to get it installed against the main branch. However, when running against the :cowboy_handler.execute/2 function, it resulted in a lot of spans and crashed the BEAM.

[debug] flame_on trace: call {:gen, :"-call/4-fun-0-", 4}, stack_size: 100
[debug] flame_on trace: call {:gen, :do_call, 4}, stack_size: 101
[debug] flame_on trace: call {:erlang, :monitor, 2}, stack_size: 102
[debug] flame_on trace: return_to {:gen, :do_call, 4}, stack_size: 103
[debug] flame_on trace: out {:gen, :do_call, 4}, stack_size: 102
[debug] flame_on trace: in {:gen, :do_call, 4}, stack_size: 103




[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
[os_mon] memory supervisor port (memsup): Erlang has closed
[1]    27037 bus error  mix phx.server

I believe this may be related to #26.

However, running against a smaller function like Phoenix.Flash.get/2 worked just fine

davydog187 avatar Apr 27 '23 18:04 davydog187

Hi - i got a stacktrace while giving it (main) a try, probably this is of any help:

[debug] Replied in 536µs
[debug] flame_on trace: call {:meck, :passthrough, 1}, stack_size: 1
[debug] flame_on trace: call {:meck_code_gen, :get_current_call, 0}, stack_size: 2
[debug] flame_on trace: return_to :undefined, stack_size: 3
[debug] flame_on trace: call {:meck_util, :original_name, 1}, stack_size: 1
[debug] flame_on trace: call {:erlang, :atom_to_list, 1}, stack_size: 2
[debug] flame_on trace: return_to :undefined, stack_size: 3
[debug] flame_on trace: call {:erlang, :++, 2}, stack_size: 1
[debug] flame_on trace: return_to :undefined, stack_size: 2
[debug] flame_on trace: call {:erlang, :list_to_atom, 1}, stack_size: 1
[debug] flame_on trace: return_to :undefined, stack_size: 2
[debug] flame_on trace: return_to :undefined, stack_size: 1
[error] GenServer FlameOn.Capture.Server terminating
** (FunctionClauseError) no function clause matching in FlameOn.Capture.Server.Stack.handle_trace_return_to/3
    (flame_on 0.5.2) lib/flame_on/capture/server/stack.ex:54: FlameOn.Capture.Server.Stack.handle_trace_return_to([%FlameOn.Capture.Block{id: "starter", children: [%FlameOn.Capture.Block{id: "0724a9fb-fb08-4904-b7a0-ed0c9380088d", children: [], duration: 6, function: {:erlang, :list_to_atom, 1}, level: 1, absolute_start: 1683622483164196, max_child_level: nil}, %FlameOn.Capture.Block{id: "81b2736a-ef0a-49cc-8e29-368e5cd8be1a", children: [], duration: 16, function: {:erlang, :++, 2}, level: 1, absolute_start: 1683622483164176, max_child_level: nil}, %FlameOn.Capture.Block{id: "4c62feb3-6e66-4625-bd55-cf74b75149e8", children: [%FlameOn.Capture.Block{id: "e10b8d3e-33fa-4e5b-9b09-662ca51c6e2a", children: [], duration: 4, function: {:erlang, :atom_to_list, 1}, level: 2, absolute_start: 1683622483164152, max_child_level: nil}], duration: 9, function: {:meck_util, :original_name, 1}, level: 1, absolute_start: 1683622483164147, max_child_level: nil}, %FlameOn.Capture.Block{id: "fb54b54b-296d-4a06-9476-800e7f555550", children: [%FlameOn.Capture.Block{id: "6cfde114-1060-46c5-9f6e-1d2c1bcdf257", children: [], duration: 4, function: {:meck_code_gen, :get_current_call, 0}, level: 2, absolute_start: 1683622483164139, max_child_level: nil}], duration: 15, function: {:meck, :passthrough, 1}, level: 1, absolute_start: 1683622483164128, max_child_level: nil}], duration: nil, function: {:cowboy_handler, :execute, 2}, level: nil, absolute_start: 0, max_child_level: nil}], :undefined, 1683622483164203)
    (flame_on 0.5.2) lib/flame_on/capture/server.ex:52: FlameOn.Capture.Server.handle_info/2
    (stdlib 4.3) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:trace_ts, #PID<0.3788.0>, :return_to, :undefined, {1683, 622483, 164203}}
State: %FlameOn.Capture.Server.State{stack: [%FlameOn.Capture.Block{id: "starter", children: [%FlameOn.Capture.Block{id: "0724a9fb-fb08-4904-b7a0-ed0c9380088d", children: [], duration: 6, function: {:erlang, :list_to_atom, 1}, level: 1, absolute_start: 1683622483164196, max_child_level: nil}, %FlameOn.Capture.Block{id: "81b2736a-ef0a-49cc-8e29-368e5cd8be1a", children: [], duration: 16, function: {:erlang, :++, 2}, level: 1, absolute_start: 1683622483164176, max_child_level: nil}, %FlameOn.Capture.Block{id: "4c62feb3-6e66-4625-bd55-cf74b75149e8", children: [%FlameOn.Capture.Block{id: "e10b8d3e-33fa-4e5b-9b09-662ca51c6e2a", children: [], duration: 4, function: {:erlang, :atom_to_list, 1}, level: 2, absolute_start: 1683622483164152, max_child_level: nil}], duration: 9, function: {:meck_util, :original_name, 1}, level: 1, absolute_start: 1683622483164147, max_child_level: nil}, %FlameOn.Capture.Block{id: "fb54b54b-296d-4a06-9476-800e7f555550", children: [%FlameOn.Capture.Block{id: "6cfde114-1060-46c5-9f6e-1d2c1bcdf257", children: [], duration: 4, function: {:meck_code_gen, :get_current_call, 0}, level: 2, absolute_start: 1683622483164139, max_child_level: nil}], duration: 15, function: {:meck, :passthrough, 1}, level: 1, absolute_start: 1683622483164128, max_child_level: nil}], duration: nil, function: {:cowboy_handler, :execute, 2}, level: nil, absolute_start: 0, max_child_level: nil}], config: %FlameOn.Capture.Config{module: :cowboy_handler, function: :execute, arity: 2, timeout: 15000, target_node: :nonode@nohost, reply_to: {:live_component, #PID<0.3772.0>, :flame_on_component}}, trace_started?: false}

florianb avatar May 09 '23 08:05 florianb

@davydog187 @florianb I have pushed some changes to main, can you take a look and let me know if you are still getting these issues?

TheFirstAvenger avatar Jun 10 '24 13:06 TheFirstAvenger

Thank you very much @TheFirstAvenger - i won't be able to verify it before Friday, i hope that's fine?

florianb avatar Jun 10 '24 16:06 florianb

I am going to close this ticket as the original request (0.18) is already in main. If you are still getting the issues you were, please open a new issue with the details.

TheFirstAvenger avatar Jun 15 '24 19:06 TheFirstAvenger