In my project backend sends a lot of messages published to different channels.
I can see from browser console the message arrived has channel
property.
But the problem is a callback passed to swampdragon.onChannelMessage
doesn't get that channel information. It gets strange channels list instead.
So when a message arrives (in browser) I can't figure out the channel it was published to and therefore handle it properly.
I found the code where that channel info is stripped off https://github.com/jonashagstedt/swampdragon/blob/master/swampdragon/static/swampdragon/js/dist/swampdragon.js#L261
if ('channel' in e.data) {
var channel = swampDragon.channels[e.data.channel];
delete(e.data['channel']);
swampDragon.settings.onchannelmessage(channel, e.data);
return;
}
So my question is how frontend developer can figure out what channel the message arrived was published to in order to be able to handle the message properly?