Skip to content

Conversation

bhavanesh2001
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

The modern Picker API doesn't handle cancellations, so when the user dismisses the picker, the task’s result is never set.

Issues Fixed

Fixes #29490

@bhavanesh2001 bhavanesh2001 requested a review from a team as a code owner May 14, 2025 16:33
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 14, 2025
Copy link
Contributor

Hey there @@bhavanesh2001! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bhavanesh2001
Copy link
Contributor Author

cc @MartyIX

@PureWeen PureWeen added this to the .NET 9 SR8 milestone May 15, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing May 15, 2025
@PureWeen PureWeen added the p/0 Work that we can't release without label May 15, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing May 15, 2025
@jfversluis
Copy link
Member

jfversluis commented May 15, 2025

@bhavanesh2001 I made big changes for MediaPicker .NET 10, can you have a look if and how we should apply that there?

@mattleibow
Copy link
Member

/rebase

@mattleibow
Copy link
Member

Sorry, using this PR as a guinea pig for the PR format workflow.

@bhavanesh2001
Copy link
Contributor Author

@jfversluis I verified the new MediaPicker implementation. Cancellation appears to be handled correctly — the CompletedHandler is invoked whether the user selects media or cancels the picker, and in both cases the tcs is properly resolved.

Delegate = new Media.PhotoPickerDelegate
{
CompletedHandler = res =>
tcs.TrySetResult(PickerResultsToMediaFile(res))
}

@mattleibow
Copy link
Member

/rebase

@PureWeen PureWeen changed the base branch from main to inflight/current May 15, 2025 19:59
@PureWeen PureWeen merged commit 7a61c3d into dotnet:inflight/current May 15, 2025
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing May 15, 2025
@jfversluis
Copy link
Member

jfversluis commented May 16, 2025

@bhavanesh2001 yeah I'm more worried about when we are going to merge this code and the .NET 10 code for MediaPicker, but we'll see about that when we get there. Thanks for this!

Bhavanesh just informed me this is File picker... Not Media picker. Time for weekend...

PureWeen pushed a commit that referenced this pull request May 21, 2025
PureWeen pushed a commit that referenced this pull request May 21, 2025
github-actions bot pushed a commit that referenced this pull request May 22, 2025
github-actions bot pushed a commit that referenced this pull request May 30, 2025
github-actions bot pushed a commit that referenced this pull request May 30, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community ✨ Community Contribution p/0 Work that we can't release without
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

FilePicker.PickAsync Task Hangs When User Cancels the Picker in iOS
4 participants