-
Notifications
You must be signed in to change notification settings - Fork 21
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
The relative future provided by any plugin call is not getting completed. #35
Comments
Request Id: 71045 |
Thank you, @DK070202 , for reporting this issue. When we redevelop our plugin in Flutter in Future, we will be removing the "Future" declaration, and it will simply be "void." Therefore, please call the method without the "await" keyword. |
But behind the scenes, actual implementation will definitely be async that's how Flutter has API for method channels. And at my sight the are no advantages to hiding async implementation but there are certain disadvantages of it. Apart from that not completing the method call is the main concern here. It may lead the app to undefined memory behaviors and that call (method channel) would still buffer as they haven't been marked as either completed or failed. This may also lead to the un-order event in some edge cases: doCreateOrder(); //--> App logic
sendCreateOrder(); //--> An event with some heavy payload.
doPayment(); //--> App logic
sendPaymentCompletionEvent(); //-->An event with minimal payload. Here in this case sendPaymentCompletionEvent may called first and sendCheckoutEvent may be called after it as we don’t have async - await working here properly. Also, the method defined in the SDK returns future and if somehow one adds the await before sendCheckoutEvent then And it would be great if you share an explanation to remove futures. |
Description:
Steps to reproduce:
How it can be fixed:
success
orerror
.success
orerror
method relatively at the end of the callback.The text was updated successfully, but these errors were encountered: