dailydrip / absinthe_socket

A dart client for GraphQL subscriptions via Absinthe sockets.
https://www.smoothterminal.com
MIT License
6 stars 10 forks source link

Observer onStart Not Called #2

Open allenwyma opened 4 years ago

allenwyma commented 4 years ago

Hi Josh,

Love the plugin; using it now.

I have some users with some flaky connections (I believe), and I was trying to test if I turn off data and turn back on data, to just do a pull of latest data through graphql (since we can't get an update of the data through subscribing on a subscription), and I'm not seeing that Observer.onStart is ever called.

I also looked through the source code and I didn't see onStart ever being called, am I going crazy or is this a possible bug?

MrToshio commented 4 years ago

hello @HangingClowns ,

Could you please share an exemple of usage of this package? I keep getting errors and it really do start to drive me nuts :p

allenwyma commented 4 years ago

What errors are you getting?

I've decided to switch to using phoenix_wings directly for 3 reasons:

  1. This library probably needs to be updated (I'm okay to do that, but I believe this library is not being maintained at this moment, so even if I update the library, it will probably not be updated in pub.dev).
  2. Subscriptions, as far as I understand, do not give you any initial data, which I can do upon connection of a Phoenix socket to a channel.
  3. If I need to bring in a special library just to do subscriptions, then I might as well as just use phoenix_wings directly, since this library relies on phoenix_wings.
MrToshio commented 4 years ago

I understand, i fixed my issue by indeed updating the dependencies of this project to phoenix_wings: ^0.2.1 . Afterwards my socket would return me many times the same object and it was because i did not add the socket in the initState() but in the build of my widget. Might seems like stupid mistakes but as i start with flutter and dart it took me a lot of time to figure that out to get it working but now i'm happy to say it works. My last issue is that websocket stop to listen when i go to another app and then come back to mine but i'll probably find a way in the near future :P thank you for your help!

MrToshio commented 4 years ago

Also i tried to push a fix to this package but i do not have the right, if dailydrip could give me push right i could send a PR 👍