mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
The span around the `init` function doesn't actually add anything
useful. We always use the `PhoenixChannel` only in a particular
component, e.g. the relay will always log in using the `relay` topic
etc. Thus, when looking at the relay's logs, this `login_topic` will
simply say "relay" which is something we know by looking at the source
code.
Additionally, the "Connected to portal, waiting for `init` message" line
is no longer true. Connecting to the portal has been moved into the
internal state machine, which now causes two similar logs to be printed:
```
gateway-1 | 2024-03-05T04:45:29.671736Z INFO init{user_agent="Alpine Linux/3.19.1 (x86_64;6.6.16;) connlib/1.0.0" login_topic="gateway"}: phoenix_channel: Connected to portal, waiting for `init` message
gateway-1 | 2024-03-05T04:45:29.685338Z INFO init{user_agent="Alpine Linux/3.19.1 (x86_64;6.6.16;) connlib/1.0.0" login_topic="gateway"}: phoenix_channel: Connected to portal host=api
```
Note that the first one is lying because we simply constructed the state
machine but haven't connected to anything yet.