kdcllc / CometD.NetCore

CometD for use with Salesforce Platform Events
MIT License
29 stars 15 forks source link

On re-handshake, the client should clear the subscribed channels. #28

Open mahesh2080 opened 2 years ago

mahesh2080 commented 2 years ago

When the server asks for a re-handshake, the client should clear its state, including the subscribed channels.

We added a listener for the handshake event, and in OnMessage, we are calling GetChannel('/topic', lastReplyId).Subscribe(). In the event of a re-handshake, GetChannelreturns an existing channel from the Channels dictionary with the previously passed replyId and ignores the replyId in the current #call.

After the handshake, it should clear all non-meta channels from the Channels dictionary.

This bug causes this issue:

https://github.com/kdcllc/CometD.NetCore/issues/27

mahesh2080 commented 2 years ago

@kdcllc

Please check this fix and let me know if I can create a pull request:

https://github.com/kdcllc/CometD.NetCore/compare/dev...mahesh2080:master