Closed vizakenjack closed 4 months ago
I've also started to see some unexpected behavior like this, I'm wondering if the exact implementation of Phoenix has changed the protocol a bit.
What version of Phoenix are you using?
What version of Phoenix are you using?
I use 1.6.11 Phoenix and 2.1.1 PubSub
Took me a little digging around to figure out how to distinguish the two types of response
extension PhoenixChannelReplyIdentification on PhoenixChannelEvent {
static const String __chanReplyEventName = 'chan_reply';
static const String __replyEventName = 'phx_reply';
bool get isChanReply => value.startsWith(__chanReplyEventName);
bool get isPhxReply => value.startsWith(__replyEventName);
}
If I inspect the websocket messages I only see the phx_reply, there's no sign of the chan_reply messages which leads me to believe it's client side somehow.
Fix is in the 0.7.2 release
My code:
When I receive a reply from socket, there are two messages - one is PhoenixChannelEvent(phx_reply) and another is PhoenixChannelEvent(chan_reply_2) (with ref id)
Is that intended behavior or I am doing something wrong? Both of them responds to event.isReply, so I had to add an additional condition to prevent my code running twice.