goto-bus-stop / dart-event-source

W3C EventSource client implementation for Dart
MIT License
9 stars 12 forks source link

Reconnect after HTTP request completes #5

Closed mpx closed 5 years ago

mpx commented 5 years ago

Also handle reconnection for more error cases:

Without this fix any connections that close normally will not be retried.

Found when an event request received a 500 failure and the event-source failed altogether. In that case the 500 response body was parsed as a very short event stream and the event stream completed without a re-connection.

Also stop the event stream if the server returns a 204 No Content.

goto-bus-stop commented 5 years ago

Thanks for all the PRs! I can merge/release this tomorrow most likely (tonight if lucky but probably not). Would you like to get commit/publish access for this package? i wouldn't be surprised if there are more robustness/incompleteness issues with it and it'd be nice if my availability is not a bottleneck :)

mpx commented 5 years ago

Sure, that would be great.

I considered making my own, but this package was pretty close.

I have a couple more things I need to make it robust. Happy to help.

goto-bus-stop commented 5 years ago

What's your email to add to the pub publisher list? (if you don't like to share it publicly you can mail me at github@asdf.kooi.me)

i don't have any complicated package publishing conventions, just make sure tests pass and update the changelog. feel free to use your best judgement for everything else. i'll try to review stuff but if i'm AWOL for a bit, just go ahead and merge stuff

mpx commented 5 years ago

Email sent out of band.

Thanks, I was going ask what your publishing preferences were - sounds good. I'll continue to send the pull requests through so you can check them out if you're around.