sefidgaran / signalr_client

A Flutter SignalR Client for ASP.NET Core
https://pub.dev/packages/signalr_netcore
MIT License
71 stars 111 forks source link

Issues with sse_channel #60

Open milten21 opened 12 months ago

milten21 commented 12 months ago

When using Server Sent Events transport there are at least 2 issues caused by underlying implementation of sse_channel

  1. When access token is used it is getting overriden along with any other query parameters causing 401 error. On signalr_client side this error is not handled properly and nothing happens until handshake timeout is triggered in HubConnection.
  2. There are no stop mechanism in sse_channel so when .stop() method is called on instance of HubConnection the underlying sse connection continues to exist and receiving server sent events leading to unwanted behavior.

If anyone encounters same issues I've made a workaround for them in here.

@sefidgaran I'd be glad to help resolving these if you can suggest a solution on how to deal with sse_channel. The package itself seems to be abandoned so I'm not sure if opening PR there would work.