-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker] fix bug, sometimes double click cancel button will crash #2625
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
432d387
to
1b2d535
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. It looks good modulo some nits.
Could you also add some tests for this? I think it is possible to test with XCTests.
I don't know how to write test code to reproduce the bug. If you just open the page, multiple times and quickly click cancel button, can reproduce it. |
@iheron We can have a XCTest to manually trigger |
37b5472
to
bf84104
Compare
@cyanglaz I find a file ImagePickerPluginTests.m, it's not in the xcode project, I added it and added a function testPluginPickImageDeviceCancel. But I am not good at writing objective-c and XCTests. Could you please help me to complete the test? 😂 |
289d602
to
14a2547
Compare
@iheron I would love to, but I have other priority works to do. I will eventually circle back to this but it will take a long time. :) |
Thanks. |
plugin.result = ^(id result) { | ||
|
||
}; | ||
[plugin imagePickerControllerDidCancel:[plugin getImagePickerController]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhongwuzw thanks for your help. I add testPluginPickImageDeviceCancelClickMultipleTimes
, is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good. If you try to run the test without your change, it crashes, then you are good :)
65a9059
to
4aa6f99
Compare
Is there anything that needs to be modified now? @cyanglaz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…-player-plugin-fix * commit '25a585dfeef6d2dc224fd0dddee327372de63782': [image_picker] iOS: fix bug, sometimes double click cancel button will crash (flutter#2625) [google_maps_flutter] Add liteModeEnabled option (flutter#2449) Update README.md (flutter#2768) [url_launcher_web] Launch mailto urls in same window in Safari (flutter#2740) update README with enableJavaScript info (flutter#2766) Run publish ci check on master (flutter#2764) [image_picker] Add documentation for Android external storage permissions (flutter#2765)
Description
Sometimes double click cancel button will crash.
Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?