Closed woprandi closed 3 months ago
Hi @woprandi 👋 Thanks for opening an issue!
Are you able to provide a link to a minimal reproduction sample? It would be much easier to help if I'm able to run/debug the issue locally, thanks! 🙏
@felangel well, what's the problem with the code I posted ?
It's not clear what versions of dependencies you're using are and what environment you're running in. It would be much easier to help if you could provide a link to a GitHub repo that I could clone and run to reproduce the issue.
I can try to put together an example based on the snippets you provided but it's always much easier and less time consuming to investigate when there is a minimal reproduction sample that can quickly be cloned/run.
OK you can clone here https://github.com/woprandi/flutter_playground
You will need a websocket server to simulate (re)connections. You can use the test.py
file (pip install websockets
also).
As you can see, the code works as expected but not the test
@felangel Were you able to take a look ?
@woprandi is this still an issue? This fell off my radar, apologies :(
@felangel No problem I didn't remember about this issue. I don't know if it's still relevant. I'd need to take 5 min to retry
Closing for now since this issue is quite old and there isn't a minimal reproduction sample. If this is still a problem please file a new issue with a link to a reproduction sample, thanks!
I have this kind of code
This code works. I would like to test the automatic reconnection when websocket connection is closed (with mocktail to mock). I discovered that
stream.listen(...)
is called under the hood when usingawait for
syntax. But I'm unable to get out of the loop during test. This is what I tried.But the test fails, it does not get out the
await for
loop. How to emulate a loop exit ? I didn't get any answer on SA so maybe I'll get a fast answer here.