socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

Still maintained?

Open ollyde opened this issue 3 years ago • 20 comments

Is this library still maintained?

I see many of the releases are many months ago. Still no support for V4 unless you use the Beta 2.0.0-beta.4-nullsafety.0

If it's not maintained can we get a deprecated flag on it so it pushes others to make alternative libraries :-)

ollyde avatar Jun 22 '22 07:06 ollyde

Is this library still maintained?

I see many of the releases are many months ago. Still no support for V4 unless you use the Beta 2.0.0-beta.4-nullsafety.0

If it's not maintained can we get a deprecated flag on it so it pushes others to make alternative libraries :-)

I agree. Although the 2.0.0-beta.4-nullsafety.0 version works, there are some nuances which cause errors for example issues during reconnecting the socket etc.

AFAIK one of the main issues with websockets is that the server and client sides should be compatible with each other. So currently the only working version (for me atleast) is this beta one. Would really love a new and maintained version.

RukshanJS avatar Jun 29 '22 12:06 RukshanJS

@RukshanJS it's been very solid for us, on all platforms (Web, Android, iOS, MacOS, and Windows) using it on production feels a bit risky though.

ollyde avatar Jun 29 '22 12:06 ollyde

Yes the main functionality is working but sometimes for example when internet reconnects, the socket connection does not kick in again (works on android emulator not on a physical device hence I assumed a problem with the package)... I guess I will have to do some debugging then. 🙃

RukshanJS avatar Jun 29 '22 12:06 RukshanJS

I find that if you call disconnect, destroy or dispose it never works again, instead we just do this

_socket?.clearListeners();

Then remake it.

ollyde avatar Jun 29 '22 14:06 ollyde

I'm starting to worry about Flutter's retention in the future. And over the past 14 months, the Socket Io Client Beta version has not made any progress.

huydq88 avatar Jun 30 '22 06:06 huydq88

@huydq88 nah Flutter is booming, just this library needs some love

ollyde avatar Jun 30 '22 07:06 ollyde

I find that if you call disconnect, destroy or dispose it never works again, instead we just do this

_socket?.clearListeners();

Then remake it.

Just wanted to thank you for this. This certainly helped clear out the excess listeners but still the reconnecting thing is not working as expected on a physical device. It just throws the SocketException and does not reconnect to old socket - unless I start a new socket connection. (but works fine as expected on emulator - no SocketException there).

Since this thread is for another discussion I'll try to debug and post a separate issue if this persists.

UPDATE - found related issue => #218

RukshanJS avatar Jun 30 '22 07:06 RukshanJS

@RukshanJS we're using it on many phyiscal devices, Android, iOS, MacOS Apps, Windows Apps, Web (lots of browses) and it reconnects just fine, perhaps it's a serverside issue?

ollyde avatar Jun 30 '22 14:06 ollyde

@jumperchen any thoughts?

ollyde avatar Jun 30 '22 14:06 ollyde

@RukshanJS we're using it on many phyiscal devices, Android, iOS, MacOS Apps, Windows Apps, Web (lots of browses) and it reconnects just fine, perhaps it's a serverside issue?

😃 is that so? My backend is NestJS and using the latest versions of the packages @nestjs/[email protected] and @nestjs/[email protected]. I think they use [email protected] under the hood. I wonder what causes it to throw that SocketException in Flutter, only on the physical device. Tested several times to make sure as well. I'll update here for sure if I make any progress. Appreciate your support.

RukshanJS avatar Jun 30 '22 15:06 RukshanJS

@RukshanJS I had issues with some of the socket packages that were a bridge to socket-io. I was using a Apollo GraphQL, scrapped their built in adaptor and used the raw socket-io with a redis adaptor for scalability.

ollyde avatar Jun 30 '22 15:06 ollyde

@RukshanJS I had issues with some of the socket packages that were a bridge to socket-io. I was using a Apollo GraphQL, scrapped their built in adaptor and used the raw socket-io with a redis adaptor for scalability.

Oh maybe I should give it a try. Thanks for the tip 😃

RukshanJS avatar Jun 30 '22 15:06 RukshanJS

I am planning to start chat functionality to my app and was searching for socketIo support package... I found this but doesn't seems like it maintained from long time... Any other package suggestions? or is it possible to connect server without any package?? 🤔

rmControls avatar Jun 30 '22 20:06 rmControls

@rmControls could just use web-sockets, sure it requires a little more code and re-connection logic but it's possible and you get more control over bugs and connectivity.

ollyde avatar Jun 30 '22 21:06 ollyde

@ollydixon My socket reconnection issue is now fixed. I did some code cleaning on Flutter client and that must've fixed some listeners or instances of the socket (have to check it more). Now the reconnection is working on physical device as well as expected. So... it seems the package is ok like you said. Cheers!

RukshanJS avatar Jul 01 '22 16:07 RukshanJS

@RukshanJS if possible, can you please share the sample code which is working for you??

rmControls avatar Jul 01 '22 20:07 rmControls

@jumperchen just released a new version: https://github.com/rikulo/socket.io-client-dart/commit/e629e191657f482d155ee1574de5ca3f920b9d17

GabrielBB avatar Jul 13 '22 07:07 GabrielBB

@GabrielBB great thanks.

We really need union types 😂🙈 dynamic is dangerous.

Screenshot 2022-07-14 at 22 15 53

ollyde avatar Jul 14 '22 20:07 ollyde

@RukshanJS if possible, can you please share the sample code which is working for you??

Hi, really sorry couldn't get back to you earlier. I have hosted the full source code (with NestJS backend + Flutter frontend) which was a tutorial project that I did - https://github.com/RukshanJS/websockets-nestjs-flutter

In addition, I have written a complete tutorial that worked for me using this package. It is a three part series but if you want only the Flutter implementation, you can read the part 3 - https://dev.to/rukshanjs/part-33-how-to-create-a-server-side-timer-using-websockets-with-socketio-nestjs-and-flutter-10am or watch the part 3 on my YouTube channel https://youtu.be/kx7LQNNmTX4.

Very probable that you have found a working code by now... thought to share anyways..

RukshanJS avatar Aug 16 '22 13:08 RukshanJS

@RukshanJS thank you... that still helps....

rmControls avatar Aug 17 '22 14:08 rmControls