Skip to content
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

fix(android): calls re-saved during permission/activity result callbacks were being released #4281

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

carlpoole
Copy link
Member

@carlpoole carlpoole commented Mar 3, 2021

A bug was observed (resolves #4277) where if permission was requested and the callback contained another permission/activity launch with a result, the app would crash claiming the savedCall was null.

What was happening was the call was originally saved for the first permission request, then during the callback the call would save again for the following activity result. The initial permission request would then try to cleanup after the callback was called and remove the saved call that was still being used by the waiting callback, resulting in it being null when the second callback returned.

Fix: I moved the cleanup of the savedCall before the callback is triggered so that if the same PluginCall is saved again, it won't be accidentally removed.

@carlpoole carlpoole added this to the 3.0.0-rc milestone Mar 3, 2021
@carlpoole carlpoole self-assigned this Mar 3, 2021
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine, I hope calling release before the actual method invoke doesn't bring weird edge cases in the future

@carlpoole carlpoole merged commit 502a2d1 into main Mar 4, 2021
@carlpoole carlpoole deleted the droid-bugfix-release branch March 4, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants