You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed that if site_id_lookup returns an Integer instead of the string you will think everything works but messages will be retrieved only on the start of the request (after the client establishes the connection). Publishing new message will not transfer them in long polling chunked mode.
To explain better, once a client connects client.backlog is called to get all existing messages, that calls @bus.backlog which encodes site_id into a string and there's no issue there. Works as expected.
But later MessageBus::ConnectionManager is used to push out new messages, it uses @subscriptions[msg.site_id] to look up any clients (which is string even if the message was published with site_id set to an integer) but add_client uses client.site_id established by site_id_lookup which if it returns anything else than a string will break lookup in connection_manager.rb:25
Leaving for anyone scratching their heads.
Generally would be great to either assert returned type from site_id_lookup or convert it to a string in connection_manager.rb
That was my fault but would be great if API helped diagnose problems like that.
The text was updated successfully, but these errors were encountered:
Noticed that if site_id_lookup returns an Integer instead of the string you will think everything works but messages will be retrieved only on the start of the request (after the client establishes the connection). Publishing new message will not transfer them in long polling chunked mode.
To explain better, once a client connects
client.backlog
is called to get all existing messages, that calls@bus.backlog
which encodessite_id
into a string and there's no issue there. Works as expected.But later
MessageBus::ConnectionManager
is used to push out new messages, it uses@subscriptions[msg.site_id]
to look up any clients (which is string even if the message was published withsite_id
set to an integer) butadd_client
usesclient.site_id
established bysite_id_lookup
which if it returns anything else than a string will break lookup inconnection_manager.rb:25
Leaving for anyone scratching their heads.
Generally would be great to either assert returned type from site_id_lookup or convert it to a string in connection_manager.rb
That was my fault but would be great if API helped diagnose problems like that.
The text was updated successfully, but these errors were encountered: