-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker]returned value should be of original video on iOS. #3457
Conversation
Thanks for the submission! Could you clean up the PR (there's commented out code, which isn't something we would land) and add tests? |
Great, will follow your guide here. Besides the removing of extra logging and commented code, I need to get familiar with the test setup in the plugins, will try my best to get it through. |
I'm going to mark this as Draft for now to get it off our triage list; please mark it as ready once you've had a chance to update. |
@jerryrt I'm un-assigning myself from this PR. Please feel free to add me again when it's ready to be reviewed. |
@jerryrt how are you? we need your pr :) |
Oops, long delay here. Our project moved to a new Flutter plugin for image selection because some extra feature is needed. However, I am still willing to pickup this pull request. Since it's been days since the last check, and Flutter releases its 2.0 version, I will pull out the code to review it with current master branch, guess I could finish it in this week. |
Which plugin do you use now? |
https://github.com/fluttercandies/flutter_wechat_assets_picker Our project need the following feature which is hard to implement by current "image_picker"'s design, which is basically a Flutter wrapper over native system image picker APIs:
|
Hi. I have merged my branch with official master branch, rechecked the code, and cleaned the code in this plugin. Logging(NSLog) is all removed from the code. Only minimum comment is kept to document the different code path, but the format check in CI is still failing. Do I need to remove all the comment in the code? For the test part, the sample project within this plugin works well. Since this pull request does not change plugin API behavior, I also leave the XCTest code unmodified. But for running automated UI test, I can not find a way to successfully run the XCTest target, the console only popped out a few lines of complaint, and I have repeatedly uninstall/install several times already.
Good day. |
Hi. I'm think you should ask @stuartmorgan or @cyanglaz about this :) |
Hi, @stuartmorgan , @cyanglaz the code is cleaned and reorganized, though the CI is still complaining? Please check the last comment left on this thread for the details, and if further update is needed, I should be able to response timely for the rest of this week. |
You can click on the "Details" link for the format step to see what the formatting issues are; it's not related to comments. And to clarify, I didn't say you should remove all comments, just the commented out code.
It does change the plugin behavior though (the point of the PR is, after all, to change behavior), so needs testing—one or more tests that would fail without this PR, but path with it—per Flutter policy.
Was this via https://github.com/flutter/plugins/blob/master/script/tool/README.md#run-xctests or some other method? |
Thanks for the hint, I followed the README and run the formatter locally to solve the format issue and made another new commit of it.
Looks like it works.
Yes, this PR does change the old behavior, but I had difficulty to update/implement the test coverage code. First, I think there is no existing test coverage for video picking yet. I located the related test code here: As far as I can tell, it doesn't have a test case for video picking yet. For existing tests, the CI reported all tests passed. Second, for image picking part, the current test only tests if the picked image exists or not, but doesn't care the image's actual content at all. For my test, ideally, I should implement a video picking test logic, and check if the picked one is the same file as I prepared beforehand , but I am puzzled how I can prepare a video sample for the emulator in CI env.
Yes. For Dart test, all of the tests passed.
For XCTest, it fails.
However, I thought I found the issue this time.
I am developing and testing on a M1 mac, so this could be the reason. I am checking if I can enable the ARM64 architecture on the tests, or I will find a x86 machine to run it again locally. |
@stuartmorgan should it get approve? |
Oh my, why this MR still opened.....( @jerryrt need help? |
Yes, it is stuck somewhere. In the early feedback, I failed to run the XCTest provided by original plugin developers, if this is the only issue, I do have a x86 dev machine at the moment, will re-run the XCTest this week and post the result here. Issues from CI system are all fixed. However, if full coverage of unit/integration test is required, some help is needed, quoted from early post.
|
Sorry, I missed your earlier comment.
It does, as I said above: "It does change the plugin behavior though (the point of the PR is, after all, to change behavior), so needs testing—one or more tests that would fail without this PR, but path with it—per Flutter policy." See also https://github.com/flutter/flutter/wiki/Tree-hygiene#tests if you want more details on the policy.
Much of the code in this repository predates the strict testing policy, and our current test coverage is not where we'd like. The way test coverage improves is by applying stricter policies going forward than have been used in the past. Note that "doesn't have similar tests yet" is not one of the exemption reasons described above.
That was true before your PR as well. Again, this requires adding "one or more tests that would fail without this PR".
UI tests run in the context of the example application; I would expect that you could add a small video file to the example app, have the UI test select it, and then validate its metadata (e.g., size). Alternately, and perhaps more straightforwardly, you could extract all the logic around handling the path returned by
@jmagman Is this a known issue? I'm not up on what exactly is currently expected to work on M1. |
I believe it should work, Also, @jerryrt in the meantime, if you rebase on that, does this work?
|
Just had time to follow this. No, it failed. After rebase my branch to official master branch, here is the output from the cmd output.
|
Another follow up. After reading the official master branch's commit history, I found this plugin did have some active development since the time I put my first line of code of change. Thus , I suggest it would be better to close this PR here, and if time permits, I will create a new PR, based on the updated plugin code then, and put the new logic back. |
That looks like your tree was in a bad state, with at least part of the tools directory not synced to the same part as the rest. That script drives our CI, and there was never a state during the null safety migration where it wouldn't run.
It doesn't look like there are any conflicts; do you see issues with your patch at master? |
Thank you for your contribution. I'm going to close this PR for now since there are outstanding comments, just to get this off our PR review queue. Please don't hesitate to submit a new PR if you have the time to address the review comments. Thanks! |
[image_picker]Picked video should be of original video on iOS, i.e, no transcoding & resize.
The default pick-video behavior will get a transcoded video on iOS, which is small and of low quality, instead of the original video file. It is also not the same behavior on Android platform.
Two main problems for the video related code path:
Related issue and discussion:
flutter/flutter#55957
Pre-launch Checklist
[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.