Repository navigation
Conversation
Use canonical external-cache inputs only for incoming file-URI picker recovery success cases. Keep private capture/content fixtures and production validation unchanged, clean up owned external inputs, and assert private picker URI rejection preserves its source. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e45178d-49ea-4de1-85ae-905502e5811e
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:04 — with
GitHub Actions
Inactive
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39569Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39569" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:04 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:05 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:07 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:09 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 22, 2026 18:10 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
No blocking defects were identified, but required CI status and reported native validation remain independently unverified.
No open issues 🎉
What changed in this PR
Corrects Android MediaPicker recovery test fixtures on net11.0 to respect the private-path validation introduced by #38127, without changing production behavior.
Changes:
- Uses canonical external-cache files for five successful file-URI picker cases, preserving existing assertions.
- Tracks fixture-owned external files and deletes them during disposal.
- Adds a negative test verifying private file-URI rejection, cleared recovery state, and preservation of the source file.
| File | Description |
|---|---|
| src/Essentials/test/DeviceTests/Tests/Android/MediaPickerRecovery_Tests.cs | Corrects successful picker fixtures, adds cleanup, and tests private-file rejection. |
Review effort: Balanced
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!
Description of Change
Superseded by #39536. This exact test-only fix is now included in the consolidated PR at
63ef2602a7b7350595f10236097056991a55550e, with identical file contents and preserved attribution. This standalone PR is being closed without merging. The per-fix evidence below remains historical evidence for this PR's original head, not new native validation of the combined head; combined-head checks and pending CI are documented in #39536.Correct five Android
MediaPickerRecovery_Testscases (four methods, including a two-value theory) that supplied private app-cachefile://URIs as successful incoming picker results.FileSystemUtils.TryGetValidatedPhysicalPathintentionally rejects file paths beneath the receiving app's credential-protected or device-protected data directory, even when readable. That validation, introduced by #38127, must remain unchanged. The accepted-path case consequently throwsFileNotFoundException; the four orphaned-pick cases correctly receive no recovered results after materialization fails.Use a dedicated fixture helper to create canonical file paths under external app cache only for these successful incoming file-URI cases. Track and delete precisely those fixture-owned files during test disposal. Preserve every existing result/path/state assertion and leave private capture fixtures, content-URI fixtures, and production code unchanged.
Add
Accepted_Pick_Private_File_Uri_Is_Rejected_Without_Deleting_Sourceto explicitly require rejection, cleared active state, no recovered results, and preservation of the private source file. ExistingAndroid_FileSystemUtils_Testsalso continue to cover credential-protected and device-protected rejection and external-cache acceptance.This intentionally targets net11.0, where the baseline failures were observed. No production, public API, dependency, pipeline, GC, timeout, sleep, or skip changes. Open and recently merged PR searches by exact case, fixture file, and external-cache mechanism found no equivalent fixture correction.
Native validation: headless Android API 33 arm64 emulator; .NET SDK 11.0.100 and Android workload 37.2.15; Release builds. Temporary class-filter injection uses the run-device-tests skill's runner-module-initializer mechanism to set XHarness's
NUNIT_SKIPPED_CLASSESinclude list to the entireMediaPickerRecovery_TestsandAndroid_FileSystemUtils_Testsclasses. No method filtering or test-source exclusion. The injection is not committed.All 18 native xUnit XML files were checked for exact test-name inventory, the two theory rows, class isolation, aggregate/count consistency, intended failure messages, and zero skipped tests or fixture errors. The original inventory is 81 recovery cases plus 6 filesystem cases; the new negative control increases it to 88. Content-URI, waiter, retained-state, and private-path controls run in every full-class pass. Packaged native libraries confirm Mono (
libmonosgen-2.0.so) versus CoreCLR (libcoreclr.so).Validation commands and results
Commands below use
dotnetfrom the private pinned SDK.$OUTrepresents the local evidence directory containing the temporaryMediaClassFilter.targetsinjection; no SDK/workload or repository configuration was changed.Prerequisite build — passed:
dotnet build Microsoft.Maui.BuildTasks.slnf -c Release \ -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \ -p:IncludeTizenTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \ -p:TreatWarningsAsErrors=false -v:q -bl:"$OUT/buildtasks.binlog"Device build — passed for every table row, with
mono=truefor Mono andmono=falsefor CoreCLR, and a distinct$phasefor each row:Native execution — run three times per table row, each with a unique
$name; results as shown above. Expected-red arms returned exit code 1 and the same five intended assertion/materialization failures; green arms returned 0:Formatting — passed:
git diff --check— passed. Base:7b0ea7800db3f3faccbaecb665d32b7c61eaf932.Coverage limits: local runtime validation is Android API 33 arm64 only; no real external camera/picker launches, other Android API levels, Apple/Windows runtime runs, or full repository suite. CI results are separate from this local causal evidence.
Issues Fixed
N/A — test-fixture baseline correction identified while investigating #39536. This PR does not modify that PR or its GC changes.