-
Notifications
You must be signed in to change notification settings - Fork 309
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
Dart Functions aren't cancel safe #2511
Comments
Hi, could you please show full stacktrace to see what is going on? (e.g. by https://cjycode.com/flutter_rust_bridge/guides/how-to/stack-trace) |
Sorry had to get setup in WSL since the backtrace in windows is junk
|
Looks to me like because of the dropped future the completor needs to ignore send errors This commit fixes the issue in my code. |
Looks reasonable and feel free to PR for this! Btw, instead of ignoring the error, it may be reasonable to use |
Cool thanks. I'll throw a PR at this, but the more I've thought about it, it might be more 'correct' to wrap the dart fn in a |
Looks pretty reasonable! |
Sorry i was unable to use the bug template..it kept saying could not create issue.
Calling an Async Dart Fn in a cancelable context causes a panic.
Clone and modify the https://github.com/fzyzcjy/flutter_rust_bridge/tree/master/frb_example/dart_minimal example as follows.
Short sleep returns first and successfully returns from select function
When longer delay returns it causes a panic..I think because the future has been dropped.
Fork available at https://github.com/sampaioletti/flutter_rust_bridge/tree/cancel-async-bug
The text was updated successfully, but these errors were encountered: