J0 / phoenix_gen_socket_client

Socket client behaviour for phoenix channels
MIT License
232 stars 48 forks source link

Refs are currently integers, but should be strings #65

Closed Hannes-Steffenhagen-bd closed 2 years ago

Hannes-Steffenhagen-bd commented 2 years ago

New message refs are currently computed here:

https://github.com/J0/phoenix_gen_socket_client/blob/11ca72274437e48e4cbacc713e7e5300dcb78abc/lib/gen_socket_client.ex#L405-L412

Meaning, they are integers. However, the phoenix documentation says they should be strings.

This doesn't cause any immediate issues when dealing with endpoints that don't really do anything with their refs other than passing them back, but breaks endpoints that (correctly, if I'm reading the docs right) assume that these refs should always be strings (which happens to be the case in e.g. phoenix LiveView channels).

If there isn't anything speaking against it, I'll create a PR to address this; please LMK if you think this is a "bug" that can just be fixed, or if you consider this a "feature" (in which case the way to resolve the issue would be to add a way to override the way refs are generated).