socketcluster-server icon indicating copy to clipboard operation
socketcluster-server copied to clipboard

socket.kickOut fails

Open MegaGM opened this issue 2 years ago • 3 comments

socket.kickOut() with no arguments provided fails to unsubscribe the socket from channels.

await socket.exchange.invokePublish('foo', 1)
socket.kickOut()
await sleep(300)
await socket.exchange.invokePublish('foo', 2)

Client receives #kickOut but still receives the second message after that.
socketcluster-server v14 and v17 exhibit the same behavior.

Slightly related https://github.com/SocketCluster/socketcluster-server/issues/29

MegaGM avatar Jan 31 '23 05:01 MegaGM

I'll make PRs, which also will enable accepting arrays.
socket.kickOut(['foo', 'bar'], 'message')

MegaGM avatar Jan 31 '23 05:01 MegaGM

TODO

  • [ ] update v14 types - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64279
  • [x] update v17 types - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64280
  • [x] update docs for version next in Docusaurus

MegaGM avatar Feb 08 '23 17:02 MegaGM

I guess I'll reopen this issue until

  • [ ] npm publish socketcluster-server v14.7.3+ https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64279#issuecomment-1424385059

MegaGM avatar Feb 09 '23 19:02 MegaGM