pratikbaid3 / flutter_client_sse

Dart package to help consume SSE API. Consumes server sent events by returning parsed model of the event, id, and the data
https://pub.dev/packages/flutter_client_sse
MIT License
40 stars 41 forks source link

Subscription hangs when server responds with 4xx status code #21

Closed eye-dee closed 1 month ago

eye-dee commented 1 month ago

Hello

Please take a look at the example project here: https://github.com/eye-dee/flutter_client_sse_validation The client hangs on --SUBSCRIBING TO SSE---, when similar test with OK status code completes successfully

image
sharmaruchi30 commented 1 month ago

Hi @eye-dee, @pratikbaid3,

I encountered the same issue recently and discovered that it's due to the absence of a default case in the switch statement.

I'd like to work on this issue and will submit a PR soon if that's okay.

Thank you!

pratikbaid3 commented 1 month ago

Hey @sharmaruchi30. All contributions are welcome. In the mean time, I'll also look into it.

pratikbaid3 commented 1 month ago

Merged @sharmaruchi30 PR which logs a message on error resulting in the client looking like its hung. Hopefully, this provides a better development experience.

@eye-dee you would confirm if this fixes your issue. I'll close this once you confirm.

eye-dee commented 1 month ago

Hello @pratikbaid3 @sharmaruchi30

Thank you for the quick fix, it works on my side as well