-
Notifications
You must be signed in to change notification settings - Fork 161
Debounce silently swallows thrown errors and stalls iteration #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just coming back to and I just wrote a test for this to see if I can reproduce it.
I wasn't able to reproduce it with this. Your attached project also doesn't contain the playground so I couldn't look at your code. Could you provide more information here? |
Sorry for the missing playground file. Your code is different from my playground code in that you are using a TaskGroup and yielding or throwing everything simultaneously instead of sequentially. Try the Playground in the attached project. I can still reproduce the behaviour with it in the latest Xcode beta. |
I can reproduce it in the playground but I am a bit skeptical of the playground environment here. I wasn't able to repro this in a test case even with just using your code. Are you able to reproduce this in a non-playground environment? |
I did encounter this issue in production code and fixed it by removing the I just hacked the playground example code into the ContentView template code, and can reproduce the issue both in the Simulator and on device. |
Ah I think I know what the problem is and why I wasn't able to reproduce it. This was a change in behaviour in 5.8 for We haven't done a release since but could you try to depend on |
I just tried that and can confirm that switching to |
Thanks so much! |
I discovered while debugging an issue in my app that the async sequence returned by
AsyncThrowingStream.debounce()
silently swallows thrown exceptions, and does not terminate, instead just stalling iteration.Running this in a playground (see attached project below), the iteration prints 1, 2, 3, 4 and then just stalls.
Removing the
debounce
, iteration ends by throwing as expected.DebounceDebug.zip
The text was updated successfully, but these errors were encountered: