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

[image_picker_android] Refactor getting of paths from intent to single helper #5009

Merged
merged 14 commits into from
May 14, 2024

Conversation

gmackall
Copy link
Member

@gmackall gmackall commented Sep 26, 2023

Fixes flutter/flutter#104168

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gmackall
Copy link
Member Author

Closing for now, I still want to land this but haven't been able to work on it for a bit and won't be able to for a bit as well

@gmackall gmackall closed this Dec 13, 2023
@stepanov-standy
Copy link

@gmackall when this fix will be available?

@gmackall
Copy link
Member Author

gmackall commented Apr 24, 2024

I came back to this as I remembered I want to reland this - looking back over the comments, I'm not sure why I closed it (I must have misunderstood comments). The consensus seems to be for throwing errors across the methods, which is what the current behavior does.

I'm going to re-open, get out of draft, and then request review based on that.

@gmackall gmackall reopened this Apr 24, 2024
@gmackall gmackall changed the title [image_picker_android] Refactor getting of paths from intent [image_picker_android] Refactor getting of paths from intent to single helper May 13, 2024
@gmackall gmackall marked this pull request as ready for review May 13, 2024 23:12
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Minor comments, but LGTM

packages/image_picker/image_picker_android/CHANGELOG.md Outdated Show resolved Hide resolved
ArrayList<MediaPath> paths = getPathsFromIntent(intent, true);
// If there's no valid Uri, return an error
if (paths == null) {
finishWithError("no_valid_media_uri", "Cannot find the selected media.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we would use the same error code for all of these to make handling easier (until we have structured errors) but since we already have several different code strings and we generally consider changing platform exception error codes breaking since we leak them out of the plugin API surface, I think we're stuck with different codes for now.

(Meaning: no change needed to the PR, just leaving this as a breadcrumb for us to consider in the future.)

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label May 14, 2024
@auto-submit auto-submit bot merged commit 0e75adf into flutter:main May 14, 2024
74 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 15, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 15, 2024
flutter/packages@fd714bd...87a02e3

2024-05-15 engine-flutter-autoroll@skia.org Roll Flutter from d2da1b2 to 39651e8 (18 revisions) (flutter/packages#6738)
2024-05-15 stuartmorgan@google.com Update the repo for the 3.22 stable release (flutter/packages#6730)
2024-05-15 linxunfeng@yeah.net [webview_flutter_wkwebview] Fixes JSON.stringify() cannot serialize cyclic structures (flutter/packages#6274)
2024-05-14 louisehsu@google.com [in_app_purchase_storekit] migrate main plugin class to swift in preperation to storekit 2 (flutter/packages#6561)
2024-05-14 34871572+gmackall@users.noreply.github.com [image_picker_android] Refactor getting of paths from intent to single helper (flutter/packages#5009)
2024-05-14 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 54e6646 to 5dcb86f (1402 revisions) (flutter/packages#6727)
2024-05-14 10687576+bparrishMines@users.noreply.github.com [webview_flutter_wkwebview] Skip `withWeakReferenceTo` integration test (flutter/packages#6731)
2024-05-14 engine-flutter-autoroll@skia.org Roll Flutter from 1255435 to d2da1b2 (26 revisions) (flutter/packages#6729)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: image_picker platform-android
Projects
None yet
5 participants