Skip to content

Solve window <-> process association #778

@kraleppa

Description

@kraleppa

So there is a problem in LiveDebugger that is painful for us from the beginning - which is finding association between browser window where debugged application is running and LiveView process on the server which is responsible for rendering this application.

This is a problem for us in two cases:

  1. Sending messages and receiving messages via debug socket to/from the browser window (e.g. when we want to highlight a specific element) (associated with Create a WebSocket connection between LiveDebugger and debugged browser window #473)
  2. Finding successor of given LiveView (associated with Better successor LiveView discovery #410)

Both of this cases are not solved ideally and rely on the socket_id that is not unqiue, which could result in weird bugs.

So in the browser currently we have two things:

  • window_id which is our custom identifier of browser window
  • socket_id which does not have to be unique in the whole BEAM node (there might be liveview in different window with the same socket_id - especially problematic in case of nested LiveViews)

We'd like to have a following certain associations %{window_id => lv_pid} and %{lv_pid => window_id}. If we had these information we could solve these cases in a proper way

The goal here is to research if we're able to create above association and refactor those cases to use it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions