Repository navigation
[leak-fix] Fix TableView.Root memory leak (Fixes #37634) - #37868
github-actions[bot] wants to merge 21 commits into
Conversation
### Description of Change This pull request makes a minor update to the UI test pipeline configuration - Pipeline configuration simplification: * Removed the **duplicate** code that set the `$deviceType` variable and appended the `--skin` argument to the test command in `eng/pipelines/common/ui-tests-steps.yml`. The same code was already added at [line 133](https://github.com/dotnet/maui/blob/main/eng/pipelines/common/ui-tests-steps.yml#L133) as part of [PR #33409](#33409). The duplicate code was also added at [line 156](https://github.com/dotnet/maui/blob/main/eng/pipelines/common/ui-tests-steps.yml#L156) as part of [PR #31631](#31631).
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change This follow-up repairs the skill-evaluation failures exposed by #36799 and hardens the credentialed Vally evaluator so skill regressions, infrastructure failures, incomplete trials, parser differences, and reporting-side failures are classified accurately. ### Root Causes - `try-fix-capabilities` could exceed its numeric threshold while remaining red because Vally independently hard-fails execution errors and incomplete trials. Aggregate score never overrides those vetoes. - `pr-review-gh-auth` routed correctly, but its isolated fixture omitted the phase-specific unauthenticated public-GitHub fallback required by the grader. - Later failures exposed evaluator defects rather than skill regressions: PAT authentication did not prove model entitlement, model discovery did not initially match Vally 0.12's effective execution plan, matrix-only token offsets removed run-level rotation entropy, and parallel legs amplified shared PAT contention. - Run `31518503277` restored the synthetic target correctly, but one agent deleted Vally's pre-existing untracked `try-fix/` input to force an empty `git status`; Vally correctly treated that deletion as workspace drift. - Run `31524806025` completed every evaluation successfully, but a transient GitHub API fetch failure occurred before the comment step exported its already-computed verdict, making reporting red despite green suites. - Review found parser-semantic splits between Psych and Vally's pinned `yaml@2.9.0`: duplicate keys could be first-wins in AST policy checks but last-wins at runtime, while YAML merge keys/tags were interpreted differently and could hide executable evaluator fields from trusted validation. ### Changes - Replaced unreliable operational probes with bounded fixtures while preserving repeated trials, behavioral rubrics, strict thresholds, and hard-veto semantics. - Added the unauthenticated GitHub fallback fixture and deterministic skill-invocation/tool-call graders. - Upgraded to Vally 0.12 and made aggregation fail closed on execution errors, incomplete/skipped stimuli, malformed output, invocation failures, and missing mandatory coverage. - Added trusted fixture preparation plus path, symlink, Git, environment, executable, attachment, hook, settings, MCP, executor, and repository-control isolation. - Serialized matrix legs while retaining three trials per stimulus. - Made model discovery use only executed `eval*.vally.yaml` specs and Vally 0.12's effective executor and prompt-grader fields; implicit prompt-grader fallbacks are rejected. - Added model-aware PAT selection with run/rerun/matrix-distributed rotation and exact sentinel probes through the pinned evaluator runtime; reused it in the advisory soak. - Clarified that `try-fix` must preserve every pre-existing untracked path, including evaluator-loaded skill inputs. Trusted validation enforces both the skill contract and restoration fixture instruction while retaining `diff-empty` as the method-independent veto. - Exported the authoritative evaluation verdict before PR-comment API calls, added bounded API retries, and made comment publication advisory so transient GitHub failures cannot erase or invert the commit status. - Reduced soak workflow permissions to `contents: read` and made `/user` transport failures explicit without exposing PATs. - Made required-stimulus policy fail closed when a configured stimulus is renamed or removed, and bound each fixture marker/ref to the YAML stimulus that owns it so a correctly named decoy cannot satisfy the policy. - Parse each eval spec once and reject duplicate semantic mapping keys, textual YAML merge keys, and normalized explicit merge tags recursively before loading. This prevents Psych/Vally parser disagreement from bypassing prompt, ref, repository-control, or executable-environment validation. - Limited frozen-worktree test detection to full immutable commit IDs; ordinary explicit branch bases continue using authoritative PR file metadata. - Added deterministic regressions for model planning, PAT distribution and transport errors, deleted evaluator controls, host-only XAML invocation, evaluator-owned input preservation, required-stimulus rename/decoy/parser bypasses, branch-versus-immutable test detection, and reporting-side verdict preservation. ### Validation Current head: `fd8f3d543e1a1eb90e8432a0cbae07a18b52dbdd`. - Exact-head [Skill Validation run 31807806898](https://github.com/dotnet/maui/actions/runs/31807806898), [`maui-pr` build 1553690](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1553690), Build Analysis, CLA, static checks, Pester, and the hermeticity gate are green. - All evaluated suites passed. Key suites: `try-fix-restore-protocol` **1.00 / 1.00**, `try-fix-capabilities` **0.93 / 0.80**, `pr-review-gh-auth` **1.00 / 0.80**, and `verify-tests-fail-without-fix-capabilities` **0.94 / 0.87**. - Local trusted evaluator/reporting harness: **70 tests, 306 assertions, 0 failures/errors/skips**. - All **16** Vally specs pass strict lint with pinned `@microsoft/vally-cli@0.12.0`. - All **8** skill test directories pass trusted validation and resolve the effective plan to `gpt-5.6-sol` plus `claude-opus-5`; non-eval soak/hermeticity specs do not contaminate matrix selection. - Ruby syntax, Bash syntax, ShellCheck, workflow YAML parsing, Pester (**8 passed**), and `git diff --check` pass. - Final whole-diff review found no high-confidence correctness or security blockers; all review threads are resolved. - `pull_request_target` executes trusted workflow/helper code from default `main`; candidate selector/reporting helper behavior is therefore covered deterministically here and becomes the credentialed trusted path after merge. ### Issues Fixed Follow-up to #36799. --------- Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vally Fixture <vally-fixture@example.invalid> Copilot-Session: b9f7de2c-86d7-47cd-8ac8-aeff57d0b0f3 Copilot-Session: 806beb89-5041-4c7b-bcbf-998d6fbab8dc
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Extend the existing `release-readiness` skill with deterministic, copy-ready Preview and servicing-release handoff generation from readiness JSON plus separately verified public evidence. - Keep missing or unverified release facts as explicit `TBD` values and enforce public-safe URLs, structured metadata, NuGet configuration, and Markdown output. - Correct Preview workload installation guidance with package-source mapping and the prior-major public compatibility feed while keeping workload-set packages isolated to `dotnet-workloads`. - Add focused regression coverage and run it in the release-readiness validation workflow. The renderer is a projection of the existing readiness engines rather than a second survey, so Preview and SR semantics remain distinct while sharing one public handoff format. ### Safety and Architecture - Public output requires an explicit JSON boolean `PublicEvidence: true`. - The renderer rebuilds NuGet XML from an allow-list and accepts only public `dnceng/public` Azure Artifacts feeds or the exact NuGet.org service index. - Public evidence URLs, structured build metadata, timestamps, Markdown, local paths, credential-shaped values, and owner/sign-off prose are validated or omitted. - Workload-set packages map only to `dotnet-workloads`; component and compatibility packages resolve through their appropriate public feeds. ### What Not to Do - Do not use the handoff renderer as a second readiness survey or let it select a newer build implicitly. - Do not copy private source-page content, credentials, owners, or sign-offs into public evidence. - Do not map unrelated component packages to `dotnet-workloads`; missing upstream packages can otherwise surface as misleading authorization failures. ### Validation - `pwsh -NoProfile -File .github/skills/release-readiness/tests/Test-ReleaseHandoff.ps1` - `pwsh -NoProfile -File .github/skills/release-readiness/tests/Test-ReleaseReadiness.ps1 -SkipE2E` ### Issues Fixed N/A --------- Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3db5742d-7e40-4a23-a3ea-de3bc3f0848e
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root Cause MAUI's release flow implemented NuGet.org authentication, retries, conflict handling, quota rotation, and publishing in `eng/scripts/push_nuget_org.ps1`. Gather and push failures could also continue without failing the release. The repository additionally carried a duplicate internal release YAML. ### Description of Change This makes `eng/pipelines/ci-official-release.yml` the canonical release pipeline and moves package publication to the approved 1ES release path: - Resolve the BAR build once and run one fail-fast `darc gather-drop`, limited to BAR NuGet package assets rather than unrelated symbol/blob assets. - Preserve package include/exclude behavior and validate non-empty workload-pack and workload-manifest sets. - Produce separate SBOM-backed `MauiPacksForNuGet` and `MauiManifestsForNuGet` artifacts. - Publish from production `releaseJob` jobs with `1ES.PublishNuget@1`, `useDotNetTask: false`, and the protected `nuget.org (dotnetframework)` service connection. - Require workload packs to publish and become resolvable before manifest approval is available. - Remove `maui-release-internal.yml`, `push_nuget_org.ps1`, raw API-key inputs, and the arbitrary feed URL. - Document the canonical release and recovery procedure. No public API changes are involved. ### Duplicate and Partial-Publish Recovery Internal build [3050066](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050066) proved that the service connection authenticates, but also proved that the external-feed-backed task fails on HTTP 409 even with `allowPackageConflicts: true`. Task-level retries are unsafe after a partial batch because the retry can immediately encounter duplicates created by the first attempt. The final implementation therefore: - Generates an `expected-packages.json` identity manifest for each immutable artifact. - Rejects duplicate package identities, duplicate package file names, and unexpected `.nupkg` files before publication. - Verifies the copied helper's SHA-256 before execution. - Filters packages already visible through NuGet.org's flat-container API before publishing. - Uses separate recovery-only `nugetAlreadyAttemptedPackFilters` and `nugetAlreadyAttemptedManifestFilters` parameters for packages accepted but not yet visible during NuGet.org validation lag. - Runs `1ES.PublishNuget@1` only when packages remain and does not use task-level retries. - Verifies the complete expected package set with transient-query retries and a 30-minute deadline. ### Internal Validation - Internal branch: [`copilot/replace-custom-nuget-publishing`](https://dev.azure.com/dnceng/internal/_git/dotnet-maui?version=GBcopilot%2Freplace-custom-nuget-publishing) - Final internal commit: [`adf2ad774cd3a2092450df153e6b46a09a127552`](https://dev.azure.com/dnceng/internal/_git/dotnet-maui/commit/adf2ad774cd3a2092450df153e6b46a09a127552?refName=refs%2Fheads%2Fcopilot%2Freplace-custom-nuget-publishing) - Build 3050066 confirmed the registered `dotnet-maui-release` definition already executes the canonical YAML, so no pipeline-definition migration is needed. - Build [3050237](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050237) showed that a fail-fast unfiltered gather stops on a missing Foldable symbol blob even though the shipping NuGet package downloads successfully. The gather now uses Darc's slash-free package-asset convention to exclude symbol/blob paths while remaining fail-fast for every publishable package. - Build [3050279](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050279) confirmed the package-only gather succeeds and the `nuget.org (dotnetframework)` connection authenticates: it published `Microsoft.AspNetCore.Components.WebView.Maui.10.0.100`, then NuGet.org rejected `Microsoft.AspNetCore.Components.WebView.Maui.Msi.arm64.10.0.100` with HTTP 403. The first package lists `dotnetframework` as an owner; the MSI package lists only `Microsoft` and `Xamarin`. This is a NuGet.org package-ownership/service-connection blocker, not a pipeline task-wiring failure. - Pester 5.9.0: 1,668 tests passed, including 15 package-filtering/retry tests and 3 release-pipeline regression tests. - PowerShell parsing, YAML parsing, documentation spellcheck, and whitespace validation pass. Before production use, either the service-connection identity must be granted ownership of every MAUI package (including Xamarin-owned MSI packages), or the release pipeline must be given an approved Xamarin-scoped NuGet.org service connection. Once that external credential issue is resolved, rerun the same commit and BAR selection; the recovery logic will omit the package already published by build 3050279 and continue with the remaining set. ### What Not to Do - Do not rely on `allowPackageConflicts` for an external NuGet.org feed; build 3050066 proved it does not make 409 responses successful. - Do not add task-level retries around a multi-package publish; they are not safe after partial publication. - Do not restore broad `--continue-on-error` gather behavior; exclude non-release symbol/blob assets and keep publishable package gathering fail-fast. - Do not gather a different BAR drop while recovering a partial release; rerun the same commit and selection filters. - Do not exclude the Xamarin-owned MSI packages to make the build green; they are shipping assets and require a credential with matching NuGet.org ownership. ### Issues Fixed Fixes #36567 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Copilot-Session: 150fe76a-707e-48ca-9e9d-38bfccead829
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Enhance local net11 preview release-readiness runs with automatic health checks for the internal official `dotnet-maui` Azure DevOps pipeline (definition 1095, `dnceng/internal`). The local release-readiness skill/agent explicitly requests enriched output, then independently discovers builds for `refs/heads/net11.0` and the evaluated release branch when it exists. It requests a bounded, queue-time-ordered five-build window and prefers the newest exact-HEAD build, then scans in queue order while skipping candidates proven stale and buffering indeterminate evidence. Disagreeing possible outcomes remain UNKNOWN; a later proven-current failure remains RED only when every buffered candidate is also a completed failure/cancellation. A terminal window containing only same-branch failed/canceled indeterminate builds is `failed-or-stale` and BLOCKED because every possible build is either red or stale. The check reports build status, ID/number, source SHA, and URL. Current successful builds are green; failures/cancellations are red; partial success is a WATCH state requiring manual review; running builds are in progress; builds behind the newest trigger-eligible commit are stale; missing or malformed evidence is unknown. When branch HEAD advances, bounded local Git evaluates exact first-parent history and merge-result changes against `eng/pipelines/ci-official.yml`. Successful no-op or excluded-only advances remain current, while add/revert and merge-result-only source changes still require a newer official build. A conclusive Git non-ancestor result is stale; unavailable Git evidence remains unknown unless every possible same-branch result is independently blocking. ### Public/internal boundary Direct script output remains public-safe by default. GitHub Actions skips the internal query before invoking Azure CLI, while the local skill/agent explicitly passes `'-PublicSafe:$false'` for enriched artifacts that remain local. Public-safe output omits internal branch records, build IDs/numbers, SHAs, URLs, and the local-only table. Missing local Azure authentication fails open. Partial failures preserve successful branch evidence, so known red/stale results cannot disappear. Azure, GitHub, and local Git subprocesses have bounded execution; process exit and redirected-output draining share the same deadline. Local Git runs from the explicit repository root, performs a bounded fetch of only the evaluated branch when objects are absent, and maps unavailable currency evidence through the outcome lattice rather than assuming current or stale. Windows `.cmd`/`.bat` Azure CLI launchers run through `ComSpec` with structured arguments. Manual build overrides are accepted only when the build belongs to definition 1095, and Azure-controlled build numbers are constrained to the expected numeric format before entering agent-facing output. ### Tests - `pwsh -NoProfile -File .github/skills/release-readiness/tests/Test-ReleaseReadiness.ps1` — 2,276 passed, 0 failed - PowerShell parser validation for the helper, preview engine, and test harness - Live local smoke successfully queried both requested refs through the enriched local path - First-parent empty-commit, same-tree merge, merge-result source change, add/revert, non-ancestor, missing-object, exact/proven-current candidate selection, old-SHA retry, uncertain-failed/older-green UNKNOWN, uncertain-failed/older-failed RED, blank-source-SHA/canceled certainty, terminal failed-or-stale Details/NextAction, public-safe generic BLOCKED rendering, explicit-CWD, Windows launcher, trigger-exclusion, exact-path, timeout, auth-ordering, malformed-output, and public-redaction fixtures - GitHub Actions/public-safe smoke confirms the internal fetcher is not invoked and internal coordinates remain absent ### Design tradeoffs - Azure CLI remains the local adapter so public automation gains no credentials or SDK dependency. - A five-build, server-ordered window keeps the query bounded; selection skips conclusively stale candidates, buffers uncertainty, and reports only outcomes common to every possible currency result. - Certain terminal blocking uses a distinct `failed-or-stale` classification rather than falsely claiming the selected build is current; local guidance restores currency evidence before choosing failure repair versus a current-HEAD rerun, while public-safe output remains generic. - Local Git inspects exact first-parent commit and merge-result paths rather than an aggregate compare diff, preventing second-parent history and net-zero merges from producing false stale results while preserving add/revert evidence. - Missing local objects trigger one bounded fetch of the evaluated ref; unresolved evidence remains UNKNOWN unless every possible outcome blocks, while a conclusive non-ancestor result is stale. - Total authentication unavailability is skipped; partial access loss retains observed branch evidence. - `-InternalBuildId` remains a diagnostic override, but normal local skill/agent runs use branch-based discovery. ### Issues Fixed N/A --------- Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e39d9d4-19e4-45f5-80f1-2bb3035c18c9
Removes the repository-owned VG20 import and synchronizes the relevant Arcade credential-removal changes on `main`. Tracked by https://dev.azure.com/dnceng/internal/_workitems/edit/12131 Copilot-Session: e890b71a-c1aa-416c-a15c-be8da9fdd9b4
### Description of Change Replace MAUI's long-lived `dn-bot-ceapex-package-r` dependency with a short-lived Entra token for OneLocBuild package restores. - Acquire the Azure DevOps token through the existing DevDiv `dnceng-onelocbuild-ceapex` workload-identity service connection. - Reuse Arcade's shared `get-federated-access-token.yml` helper. - Pass the resulting secret `CeapexEntraToken` to OneLocBuild for the ceapex LCL/LocTools feeds. - Keep the existing GitHub PR authentication unchanged. The DevDiv service connection is configured for workload identity federation and MAUI pipeline 13330 is authorized to use it. ### Validation - Parsed the updated pipeline as YAML. - Verified the shared federated-token helper exists on this branch. - Verified the legacy ceapex PAT is no longer referenced by MAUI's repo-owned localization pipeline. ### Issues Fixed Tracks [dnceng work item 10151](https://dev.azure.com/dnceng/internal/_workitems/edit/10151). Copilot-Session: 80f6a0c6-7947-4200-bb78-7f0fc01d671a
…atic event with WeakEventManager (#37645) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details When a page or view model subscribes to BindingDiagnostics.BindingFailed (a helpful event that tells you when a data binding fails) and forgets to unsubscribe, that page never gets cleaned up from memory. Every page it holds — plus its images, view models, and data — stays alive until the app closes. Over time, the app uses more and more memory. ### Root Cause BindingFailed is a static event, which means it lives for the whole life of the app. Normal C# events keep a strong reference to whoever subscribed, so as long as the event is alive, its subscribers stay alive too. Since this event never goes away, any subscriber that doesn't call -= is stuck in memory forever. ### Description of Change Switched BindingFailed from a normal event to one backed by WeakEventManager, which keeps only a weak reference to subscribers — so the garbage collector can clean them up even if someone forgets to unsubscribe. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #37245 ### Fix reference [maui/src/Controls/src/Core/Application/Application.cs at bf62313 · …](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Application/Application.cs#L263) [maui/src/Controls/src/Core/Command.cs at bf62313 · dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Command.cs#L128) [maui/src/Controls/src/Core/ImageSource.cs at bf62313 · dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/ImageSource.cs#L175) ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/86c6d76d-a051-458b-beb3-6c254545f87a" >| <video src="https://github.com/user-attachments/assets/e3b02ce7-71a7-4e90-94e0-dd6587c8e3cf">|
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary - regenerate all 14 Copilot-based agentic workflows with gh-aw v0.86.2 - stage the installed Copilot CLI in a portable runner-local path instead of invoking `/usr/local/bin/copilot` - explicitly disable shell access in the automatic issue/PR labeler, as required when `min-integrity: none` - adopt gh-aw v0.86.2's intentional disabled-expiry sentinel for action-failure issues when no maintenance workflow exists ## Root cause The failing runs install Copilot CLI successfully, but gh-aw v0.85.4 then invokes `/usr/local/bin/copilot`. That path no longer exists on the hosted runner, so the engine exits with `ENOENT` before producing output or making a model request. gh-aw v0.86.2 includes the upstream path-portability fix and resolves the installed executable from `PATH`. The same generated path affected every Copilot workflow, including the labeler, whose failure reporting is intentionally disabled. Regeneration also incorporates [github/gh-aw#51425](github/gh-aw#51425). Because this repository does not generate an `agentics-maintenance.yml` consumer for the implicit action-failure expiry, all 14 lockfiles now set `GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS` to `"0"`. In gh-aw v0.86.2, explicit `0` means expiration is disabled; it prevents unenforceable expiry markers and does not make failure issues expire immediately. ## Validation - `gh aw compile --strict --validate --actionlint --no-emit` - verified all 14 lockfiles use gh-aw v0.86.2 and portable Copilot staging - verified no generated workflow references `/usr/local/bin/copilot` - verified all 14 generated locks use gh-aw's `"0"` disabled-expiry sentinel consistently No existing open MAUI PR addresses this gh-aw/Copilot path failure. Fixes #37430 Fixes #37431 Fixes #37432 Fixes #37435 Fixes #37442 --------- Co-authored-by: Copilot CI <copilot-ci@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 74cff858-a5a6-486e-a1d3-1d516fc3bdaa Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Adds .NET MAUI 10.0.100 and 11.0.0-preview.7 to both version selectors in the bug-report issue form. This lets users report issues against the released SR10 build and the active .NET 11 Preview 7 version. ---------
) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Problem The internal `dotnet-maui` official build currently fails to compile the pipeline YAML, before any stage runs: ``` /eng/pipelines/common/variables.yml (Line: 81, Col: 7): Expected at least one key-value pair in the mapping ``` ### Cause #37589 removed `- group: Publish-Build-Assets`, but that group was the only child of the conditional that enclosed it, leaving an empty block behind: ```yaml - group: AzureDevOps-Artifact-Feeds-Pats - ${{ if eq(variables['Build.DefinitionName'], 'dotnet-maui') }}: # <- nothing under it ``` Azure DevOps requires a conditional insertion block to contain at least one entry, so template expansion fails outright. ### Why PR validation stayed green The empty block is nested inside an outer guard: ```yaml - ${{ if or(eq(variables['Build.DefinitionName'], 'dotnet-maui'), eq(variables['Build.DefinitionName'], 'dotnet-maui-build')) }}: - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: ``` For the public `maui-pr` definition that outer condition is false, so Azure DevOps short-circuits and never expands the inner block. The breakage is therefore invisible to PR CI and only manifests on the internal official build. ### Fix Remove the empty conditional. No file in the repository references the `Publish-Build-Assets` variable group any more, so it is deleted outright rather than repopulated. ### Validation - `eng/pipelines/common/variables.yml` parses as valid YAML. - Swept all 39 YAML files under `eng/pipelines/` for conditional blocks with no body — this was the only one. - `grep` for `Publish-Build-Assets` across `eng/` and `.github/` returns no remaining references. This blocks the internal build entirely, so it is worth merging ahead of larger infra work such as #36257 (which carries the same one-line fix, but cannot be validated on the internal pipeline until this is on `main`). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Updates the dotnet tool version.
…le with keyboard waits (refs #37556) (#37741) > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! Workflow artifact: ci-fix Artifact kind: deflake Refs: #37556 Target branch: main Attempt: 1/10 ## Attempt 1 of 10 Synchronize the test with actual keyboard visibility before validating the keyboard-dependent safe-area layouts. ### Previous attempts (prior commits on this PR) None. This attempt differs by: this is the first attempt. ## Root cause The latest `main` build 1563072 failed `SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle` on run 0 because `ContentGrid` had not shrunk after tapping the entry, then passed on built-in retry run 1. The test immediately queried layout after the tap and immediately changed edges after dismissing the keyboard, without first proving either keyboard transition completed. Flake class: test-quality ## Why this was flaky `Issue28986_ContentPage.SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle` retried its layout assertion but had no synchronization point confirming that Android had shown the keyboard. It also dismissed the keyboard and immediately restored all safe-area edges. Depending on keyboard animation timing, the assertions could observe the pre-transition layout; build 1563072 demonstrates the intermittent fail-then-pass behavior. ## De-flake The test now asserts `WaitForKeyboardToShow()` before measuring the keyboard-visible layout and `WaitForKeyboardToHide()` before restoring all safe-area edges. Every existing layout assertion remains unchanged. No timeout was increased, no retry attribute was added, and no assertion was weakened. ## Fix Add the existing Appium keyboard-state waits at the two transition boundaries so the test evaluates the same behavior in deterministic UI states. ## What is unverified / where I need help - The Android UI test could not be run because this runner has no device rig. - Please confirm the API 36 SafeAreaEdges leg consistently observes both transitions and preserves the intended edge-toggle sequence. ## Validation - Command: `not run because no Android device rig is available` - Result: not run ## Evidence - Original failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1554582 - Latest verified-failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1563072 --- Filed by [`ci-status-fix`](https://github.com/dotnet/maui/blob/main/.github/workflows/ci-status-fix.md). This is the single PR for #37556: the workflow watches its own CI and pushes up to **10 attempts on this same PR** (it never opens a second PR). It advances only when the fix's own build settles red and that red is caused by the fix. Comments, reviews, and commits do not transfer ownership; the loop remains autonomous until this PR is closed. Eligible `CHANGES_REQUESTED` reviews are handled through Track C. After 10 attempts it stops and defers to humans. In round 1 a maintainer still needs to comment `/azp run maui-pr` (plus the gated uitests/devicetests legs when relevant) to exercise each new commit. > [!WARNING] > <details> > <summary>Firewall blocked 1 domain</summary> > > The following domain was blocked by the firewall during workflow execution: > > - `dc.services.visualstudio.com` > > To allow these domains, add them to the `network.allowed` list in your workflow frontmatter: > > ```yaml > network: > allowed: > - defaults > - "dc.services.visualstudio.com" > ``` > > See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information. > > </details> > Generated by [CI Failure Fixer (main)](https://github.com/dotnet/maui/actions/runs/32573008235) · gpt56 · 446.8 AIC · ⌖ 82.9 AIC · ⊞ 31.1K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+ci-status-fix%22&type=pullrequests) <!-- gh-aw-agentic-workflow: CI Failure Fixer (main), engine: copilot, model: gpt-5.6-sol, id: 32573008235, workflow_id: ci-status-fix, run: https://github.com/dotnet/maui/actions/runs/32573008235 --> <!-- gh-aw-workflow-id: ci-status-fix --> <!-- gh-aw-workflow-call-id: dotnet/maui/ci-status-fix --> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…37557) (#37742) > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! Workflow artifact: ci-fix Artifact kind: deflake Refs: #37557 Target branch: main Attempt: 1/10 ## Attempt 1 of 10 Synchronize `SafeAreaPerEdgeValidation` with actual keyboard visibility before validating keyboard-dependent safe-area layouts. ### Previous attempts (prior commits on this PR) None. This attempt differs by: this is the first attempt. ## Root cause The latest `main` build 1563072 failed `Issue28986.SafeAreaPerEdgeValidation` on run 0 because `ContentGrid` remained at height 2789 after tapping the entry, then passed on built-in retry run 1. The test immediately queried layout after the tap without proving that Android had shown the keyboard. Flake class: test-quality ## Why this was flaky `Issue28986.SafeAreaPerEdgeValidation` retried its layout assertion but had no synchronization point confirming that Android had completed the keyboard transition. Depending on keyboard animation timing, the assertion could poll the unchanged pre-keyboard layout; build 1563072 demonstrates the intermittent fail-then-pass behavior. ## De-flake The test now asserts `WaitForKeyboardToShow()` before measuring the keyboard-visible layout and `WaitForKeyboardToHide()` before validating the restored layout. Every existing layout assertion remains unchanged. No timeout was increased, no retry attribute was added, and no assertion was weakened. ## Fix Add the existing Appium keyboard-state waits at the two transition boundaries so the test evaluates the same behavior in deterministic UI states. ## What is unverified / where I need help - The Android UI test could not be run because this runner has no device rig. - Please confirm the API 36 SafeAreaEdges leg consistently observes both transitions. ## Validation - Command: `not run because no Android device rig is available` - Result: not run ## Evidence - Original failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1554582 - Latest verified-failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1563072 --- Filed by [`ci-status-fix`](https://github.com/dotnet/maui/blob/main/.github/workflows/ci-status-fix.md). This is the single PR for #37557: the workflow watches its own CI and pushes up to **10 attempts on this same PR** (it never opens a second PR). It advances only when the fix's own build settles red and that red is caused by the fix. Comments, reviews, and commits do not transfer ownership; the loop remains autonomous until this PR is closed. Eligible `CHANGES_REQUESTED` reviews are handled through Track C. After 10 attempts it stops and defers to humans. In round 1 a maintainer still needs to comment `/azp run maui-pr` (plus the gated uitests/devicetests legs when relevant) to exercise each new commit. > [!WARNING] > <details> > <summary>Firewall blocked 1 domain</summary> > > The following domain was blocked by the firewall during workflow execution: > > - `dc.services.visualstudio.com` > > To allow these domains, add them to the `network.allowed` list in your workflow frontmatter: > > ```yaml > network: > allowed: > - defaults > - "dc.services.visualstudio.com" > ``` > > See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information. > > </details> > Generated by [CI Failure Fixer (main)](https://github.com/dotnet/maui/actions/runs/32573008235) · gpt56 · 446.8 AIC · ⌖ 82.9 AIC · ⊞ 31.1K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+ci-status-fix%22&type=pullrequests) <!-- gh-aw-agentic-workflow: CI Failure Fixer (main), engine: copilot, model: gpt-5.6-sol, id: 32573008235, workflow_id: ci-status-fix, run: https://github.com/dotnet/maui/actions/runs/32573008235 --> <!-- gh-aw-workflow-id: ci-status-fix --> <!-- gh-aw-workflow-call-id: dotnet/maui/ci-status-fix --> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
This pull request updates the following dependencies [marker]: <> (Begin:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) ## From https://github.com/dotnet/xharness - **Subscription**: [a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95](https://maestro.dot.net/subscriptions?search=a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) - **Build**: [20260819.1](https://dev.azure.com/dnceng/internal/_build/results?buildId=3051693) ([327705](https://maestro.dot.net/channel/2/github:dotnet:xharness/build/327705)) - **Date Produced**: August 19, 2026 8:47:15 AM UTC - **Commit**: [8dd9b8e6004e22c7b120af0631f0809865ff2088](dotnet/xharness@8dd9b8e) - **Branch**: [main](https://github.com/dotnet/xharness/tree/main) [DependencyUpdate]: <> (Begin) - **Dependency Updates**: - From [11.0.0-prerelease.26230.4 to 11.0.0-prerelease.26419.1][1] - Microsoft.DotNet.XHarness.CLI - Microsoft.DotNet.XHarness.TestRunners.Common - Microsoft.DotNet.XHarness.TestRunners.Xunit [1]: dotnet/xharness@92962e5...8dd9b8e [DependencyUpdate]: <> (End) [marker]: <> (End:a71c12d9-5aa4-4b46-e2d6-08da0cf8cd95) --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions <github-actions@xamarin.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
### Description of Change Use the latest version of Mono.Cecil to get a fix to not corrupt pdbs. ### Issues Fixed Fixes #37782.
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary - gate every previously unguarded scheduled workflow root job to the canonical `dotnet/maui` repository - gate agentic workflow `pre_activation` jobs so forks cannot reach PAT selection or Copilot inference - preserve regression scanner candidate and trusted-branch checks as additive activation conditions - make the seven-day gh-aw action-failure issue expiry an explicit repository policy - regenerate the affected gh-aw lock files ## Why Forks that enable GitHub Actions inherit scheduled workflows from this repository. Without repository guards, those schedules can consume fork owner Actions minutes and Copilot credits even when the fork is otherwise idle. Every scheduled workflow now has an upstream-only condition on each root job. A scheduled run recorded by GitHub in a fork therefore contains only skipped jobs and consumes no runner or inference work. Manual `workflow_dispatch` runs can select an arbitrary ref, so the regression scanner trusted-main restriction also covers `pre_activation`, where checkout and deterministic PowerShell execute with `GH_TOKEN` before agent activation. Current-main gh-aw defaults action-failure issues to a seven-day lifetime. `.github/workflows/aw.json` records that policy explicitly so regenerated locks do not introduce an undocumented retention change. ## Validation - main-pinned gh-aw v0.86.2 strict compilation with `--validate --no-check-update` - 591 targeted Pester tests across the CI scanner workflow suites - 77 focused `Find-RegressionFixPRs` Pester tests - structural check covering every scheduled workflow root job --------- Co-authored-by: Copilot CI <copilot-ci@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
…ead callers (#37680) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. ### Root Cause The regression was introduced when Android screenshot capture switched from synchronous Canvas rendering to asynchronous `PixelCopy` to support hardware-rendered content such as WebView. #35384 `PixelCopy` delivered its completion callback on `Looper.MainLooper`, while Sentry synchronously waited for `Screenshot.Default.CaptureAsync().GetAwaiter().GetResult()` on the UI thread. This created a circular dependency: the UI thread blocked waiting for the screenshot task, and the `PixelCopy` callback could not execute because it also required the UI thread, resulting in a deadlock. ### Description of Change The fix retains `PixelCopy` but moves its completion callback from `Looper.MainLooper` to a shared, process-wide `HandlerThread`, allowing the screenshot task to complete even when the UI thread is synchronously blocked. Additionally, the internal await chain now uses `ConfigureAwait(false)` to avoid resuming on the UI thread. The legacy Canvas/DrawingCache fallback is guarded to run only on the main thread; if `PixelCopy` fails asynchronously on a worker thread, screenshot capture safely returns failure instead of risking off-thread Android View access or recreating the deadlock. ### Regressed By #35384 ### Issues Fixed Fixes #37638 ### Platforms Tested - [ ] iOS - [ ] MacCatalyst - [x] Android - [ ] Windows ### Note The regression test is **Android-only** because the deadlock originates in Android’s PixelCopy callback and main-looper implementation. Other platforms use different screenshot implementations and cannot exercise this code path. The test models Sentry’s relevant synchronous behavior directly to avoid adding a third-party dependency to the shared HostApp. ### Screenshots | Before Issue Fix | After Issue Fix | |------------------|-----------------| | <video width="350" alt="withoutfix" src="https://github.com/user-attachments/assets/72e74130-9f1b-4751-8d36-a777f3fc256c" /> | <video width="350" alt="withfix" src="https://github.com/user-attachments/assets/d4e9c8d2-cfa5-4f03-a8cc-f67fd5fa004f" /> |
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change This updates the MAUI Aspire Service Defaults template to: - use the current `Aspire` product name in the editable English localization source; - link Service Defaults documentation directly to `aspire.dev`; - link third-party notices directly to the current `microsoft/aspire` repository. PR #32626 corrected the main template manifest but intentionally reverted localization files. This follow-up updates `templatestrings.en.json`, the editable source of the English localization metadata. Generated `templatestrings.json`, translated JSON files, and `loc/**.lcl` files remain unchanged so the repository's OneLocBuild workflow can generate the localization follow-up. ### Issues Fixed Follow-up to #32624 and #32626. ### Validation - Built and packed `Microsoft.Maui.Templates.csproj`. - Verified the packaged English template metadata uses `Aspire`. - Verified both replacement links resolve. - Verified no editable `.NET Aspire` references or legacy Aspire links remain. Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Adds first-class Release Candidate support to the .NET MAUI release-readiness workflow. The workflow now: - discovers strict `release/<major>.0.<band>xx-rc<N>` branches and RC tags; - tracks RC candidate, in-flight, shipped, and cut-before-bump transitions without inventing Preview 8; - derives the matching SDK channel, such as `.NET 11.0.1xx SDK RC 1`; - validates the outward MAUI default-channel mapping independently from inbound Android and macOS/iOS subscriptions; - requires RC subscriptions to be enabled and on the matching channel while preserving Preview's existing non-blocking subscription severity; - keeps VMR reconciliation local and blocks only an enabled `dotnet/dotnet` subscription; - emits missing mappings as explicit blockers in JSON and Markdown; - routes RC trackers through workflow reporting and release-handoff generation; - filters release-relevant issues by the active Preview/RC stage. ### Root Cause Tracker discovery and the prerelease report engine only understood Preview branches. RC branches were ignored or rejected, so the normal report could not expose a missing mapping such as: `release/11.0.1xx-rc1` → `.NET 11.0.1xx SDK RC 1` The existing dependency-flow presentation also did not deterministically separate MAUI's outward default-channel mapping from Android/macOS-iOS inbound subscriptions and local VMR reconciliation. ### Key Technical Details - **Outward flow:** MAUI branch builds require an enabled default-channel mapping to the matching Preview/RC SDK channel. - **Inbound flow:** Android and macOS/iOS subscriptions are checked separately for target branch, channel, and enabled state. - **VMR:** no enabled `dotnet/dotnet` subscription is expected; the official SDK/runtime pin is reconciled locally. - **CLI behavior:** the exact `darc get-subscriptions` empty-result response (exit 42 plus `No subscriptions found matching the specified criteria.`) is normalized to an empty successful query so missing RC subscriptions become deterministic blockers rather than `UNKNOWN`. - **Public safety:** environments without authenticated `darc` continue to report dependency-flow evidence as `UNKNOWN` instead of guessing. ### Tests - `pwsh -NoProfile -File .github/skills/release-readiness/tests/Test-ReleaseReadiness.ps1` - **2,466 passed, 0 failed** - Live RC1 report validation confirmed the generated JSON and Markdown identify the missing default-channel mapping as `BLOCKED` while reporting the Android/macOS-iOS subscriptions and local VMR model separately. - Live enabled Preview mapping validation confirmed existing Preview mapping detection remains `READY`. - Focused fixtures cover RC branch/tag discovery, RC1/RC2 transitions, channel derivation, mapping missing/present, subscription state and severity, VMR enabled/disabled behavior, stage-aware issue filtering, and exact `darc` empty-result handling. ### Limitations RC package-level consumer installability remains `UNKNOWN` until the workload-set package resolver supports RC package identities. ### Issues Fixed N/A — release tooling enhancement.
Replace strong TableRoot event subscriptions with weak proxies so a shared root no longer retains its TableView. Add a regression test that fails without the fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This pull request addresses a managed memory leak where assigning a long-lived/shared TableRoot to TableView.Root could retain a discarded TableView via strong event subscriptions. The fix moves TableRoot event wiring behind weak-event proxies and adds a regression test which verifies the TableView can be collected while the shared root remains alive.
Changes:
- Replace strong
TableRootevent subscriptions with weak-proxy subscriptions centralized in aTableRootEventSubscriptionholder. - Add a unit test (
SharedRootDoesNotRetainTableView) to prevent regressions for shared-root retention.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Controls/src/Core/TableView/TableView.cs | Routes CollectionChanged, SectionCollectionChanged, and PropertyChanged through weak proxies to avoid TableRoot retaining TableView. |
| src/Controls/tests/Core.UnitTests/TableViewUnitTests.cs | Adds a regression test ensuring a shared TableRoot does not keep a TableView alive after GC. |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 4 findings
See inline comments for details.
| [Fact] | ||
| public async Task SharedRootDoesNotRetainTableView() | ||
| { | ||
| var sharedRoot = new TableRoot(); |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Regression Prevention — The only new test asserts non-retention, and it does so against an empty TableRoot. Two gaps:
- Scenario fidelity: the reported leak involves a shared/long-lived root that actually has content. With
new TableRoot()theRoot.SelectMany(r => r).ForEach(cell => cell.Parent = this)line inTableView.Rootnever executes, andSetInheritedBindingContextwalks nothing, so none of the section/cell graph edges are exercised. Add a section with a cell (e.g.sharedRoot.Add(new TableSection("s") { new TextCell() })) so the test covers the real shape. - No functional assertion:
WeakEventProxyholds the handler weakly, so event delivery now depends entirely onTableRootEventSubscriptionkeeping_collectionChanged/_sectionCollectionChanged/_propertyChangedalive in fields. If that invariant is ever broken (field dropped, delegate rebuilt per-call), notifications silently stop and this test still passes green. Concrete scenario:table.Root.Add(new TableSection())andsection.Add(new TextCell())must still raiseModelChangedon theTableView, and aTableRoot.Titlechange must still callOnModelChanged. Please assert those three paths after the refactor.
| { | ||
| _collectionChanged = parent.CollectionChanged; | ||
| _sectionCollectionChanged = parent.OnSectionCollectionChanged; | ||
| _propertyChanged = parent.OnTableModelRootPropertyChanged; |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Logic and Correctness — Routing OnTableModelRootPropertyChanged through ApplyEvents changes when it is subscribed, and nothing pins the new behavior.
Previously it was hooked only in the TableView.Root property setter, so new TableView(root) (the TableView(TableRoot) ctor, which assigns _tableModel = new TableSectionModel(this, root) and never touches the Root property) never subscribed to the root's PropertyChanged. After this change TableSectionModel's ctor calls ApplyEvents, so a ctor-supplied root now also fires OnModelChanged() on TableSectionBase.Title changes.
Relatedly, the two lines removed from the Root setter mean OnSectionCollectionChanged is now subscribed once instead of twice (the setter and ApplyEvents both added it before), so OnModelChanged() now runs once per section change instead of twice.
Both look like intended improvements, but they are user-visible behavior changes to a shipped control and neither is covered by a test. Please confirm they are deliberate and add assertions (ctor-supplied root reacts to Title; a single section change triggers exactly one ModelChanged).
| public TableSectionModel(TableView tableParent, TableRoot tableRoot) | ||
| { | ||
| _parent = tableParent; | ||
| _rootEvents = new TableRootEventSubscription(tableParent); |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[minor] Complexity Reduction — Now that ApplyEvents/RemoveEvents delegate to _rootEvents, the TableSectionModel._parent field (declared line 190, assigned line 196) is written but never read anywhere in the file — TableSectionModel is not partial and _parent has no other use. It is dead state that still forms a strong TableSectionModel → TableView edge. Either remove the field, or pass tableParent straight to new TableRootEventSubscription(...) without storing it.
(Verified this does not break the build: CS0414 is not raised for an unused private reference-type field assigned from a ctor parameter, so TreatWarningsAsErrors is not tripped.)
| } | ||
| } | ||
|
|
||
| sealed class WeakSectionCollectionChangedProxy : WeakEventProxy<TableRoot, EventHandler<ChildCollectionChangedEventArgs>> |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[minor] Architectural Layer Placement — WeakSectionCollectionChangedProxy reproduces the exact shape of the existing proxies (WeakNotifyCollectionChangedProxy, WeakNotifyPropertyChangedProxy, WeakNotifyPropertyChangingProxy, WeakGeometryChangedProxy) that all live together in src/Controls/src/Core/Internals/WeakEventProxy.cs, but is nested three levels deep inside TableView.TableSectionModel. Since TableRoot.SectionCollectionChanged is internal and TableView is currently its only consumer, nesting is defensible — but moving it next to its siblings keeps the weak-event pattern discoverable and reviewable in one place. Non-blocking; author's call.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@github-actions[bot] — new AI review results are available based on commit
e15ff46.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: IOS · Base: main · Merge base: 073c90c8
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🧪 TableViewUnitTests TableViewUnitTests |
✅ FAIL — 54s | ✅ PASS — 28s |
🔴 Without fix — 🧪 TableViewUnitTests: FAIL ✅ · 54s
Error-relevant lines (filtered from the build log):
at Microsoft.Maui.Controls.Core.UnitTests.TableViewUnitTests.SharedRootDoesNotRetainTableView() in /_/src/Controls/tests/Core.UnitTests/TableViewUnitTests.cs:line 91
🟢 With fix — 🧪 TableViewUnitTests: PASS ✅ · 28s
Determining projects to restore...
All projects are up-to-date for restore.
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core.UnitTests/Debug/net10.0/Microsoft.Maui.Controls.Core.UnitTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.20] Discovering: Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:01.14] Discovered: Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:01.15] Starting: Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:01.26] Finished: Microsoft.Maui.Controls.Core.UnitTests
Passed BindingsContextChainsToModel [21 ms]
Passed TestModelChanged [< 1 ms]
Passed ParentsViewCells [17 ms]
Passed SharedRootDoesNotRetainTableView [29 ms]
Passed ParentsAddedViewCells [< 1 ms]
Passed TestConstructor [1 ms]
Test Run Successful.
Total tests: 6
Passed: 6
Total time: 1.7609 Seconds
📁 Fix files reverted (1 files)
src/Controls/src/Core/TableView/TableView.cs
📋 Pre-Flight — Context & Validation
Issue: #37634 - [leak-scan] TableView.Root — shared root event subscriptions retain the view
PR: #37868 - [leak-fix] Fix TableView.Root memory leak (Fixes #37634)
Platform Requested: iOS
Platforms Affected: All platforms (managed cross-platform code)
Files Changed: 1 implementation, 1 unit test
Gate: PASSED — primary test fails without the PR fix and passes with it; do not rerun gate verification
Problem
A long-lived or shared TableRoot strongly retains a discarded TableView through root collection, section-collection, and property-change event delegates. The retention chain also keeps the view's binding context alive. Replacing Root removes the subscriptions, but there is no teardown when the view itself becomes unreachable.
PR Fix
The PR moves all three root subscriptions into a finalizable TableRootEventSubscription owned by TableSectionModel. It uses WeakNotifyCollectionChangedProxy, WeakNotifyPropertyChangedProxy, and a new weak proxy for SectionCollectionChanged, allowing the TableView to be collected while a shared root remains alive.
Changed Files
- Implementation:
src/Controls/src/Core/TableView/TableView.cs - Test:
src/Controls/tests/Core.UnitTests/TableViewUnitTests.cs
Primary Test
dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "FullyQualifiedName=Microsoft.Maui.Controls.Core.UnitTests.TableViewUnitTests.SharedRootDoesNotRetainTableView"No additional mandatory regression tests were enumerated in the STEP 5a request.
Try-Fix Boundaries
- Generate one mechanism-level alternative per candidate, different from the PR's weak-proxy subscription holder.
- The only production target is
src/Controls/src/Core/TableView/TableView.cs; the regression test is read-only. - Run only the primary test above.
- Preserve event behavior when roots are replaced and when sections, cells, or section titles change.
- Do not modify public API.
- Do not run gate verification or any full test suite.
- Each candidate gets one implementation/test pass and at most one focused correction/retest.
Pre-Flight Review
Dedicated expert review is intentionally deferred to STEP 5b. No expert-review agent was launched in this phase.
🔬 Code Review — Deep Analysis
Expert PR Evaluation
Verdict: Approve with minor comments
Confidence: High for the memory/lifecycle fix; medium for the two notification behavior changes that are not fully pinned by tests.
Independent assessment
The submitted fix replaces three strong TableRoot event subscriptions with WeakEventProxy subscriptions owned by a private TableRootEventSubscription. The holder roots the handler delegates for the TableView lifetime and its finalizer detaches the proxies. This breaks the long-lived TableRoot -> delegate -> TableView retention chain while preserving root-swap subscribe/unsubscribe symmetry.
The reference graph and lifecycle are sound:
- A shared root strongly retains proxy instances, but each proxy only weakly references the
TableView. TableRootEventSubscriptionkeeps the weakly held handler delegates alive while the view's model is alive.- Finalizer-driven
Unsubscribe()follows the repository's establishedWeakEventProxypattern. - Root replacement detaches the old subscription before attaching the new one, without accumulating handlers.
Findings
- Moderate — regression coverage:
SharedRootDoesNotRetainTableViewuses an empty root, so it does not exercise the section/cell graph, and it proves collection only—not that notifications still flow through the weak proxies. - Moderate — behavior changes need coverage: constructor-supplied roots now receive
PropertyChangednotifications, while section collection changes now produce oneModelChangednotification rather than the prior duplicate. Both behaviors should be explicitly pinned. - Minor — dead state:
TableSectionModel._parentis write-only after the subscription holder is introduced. - Minor — placement:
WeakSectionCollectionChangedProxycould live beside the other weak proxy helpers, but moving it is cosmetic and not necessary for correctness.
Recommended consolidated refinement
Strengthen the leak test with a populated root, add one focused functional test covering root, section, and property notifications (including exactly-once section notification and a constructor-supplied root), and remove the dead _parent field. Keep the proxy placement unchanged to avoid unrelated churn.
No blocking correctness defect was found in the submitted leak fix.
🛠️ Try-Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | claude-opus-5 / try-fix |
Weak-target root event relay: keep TableRoot -> relay strong but make relay -> TableView weak, with lazy self-detach |
0 files | Baseline script rejected the pre-existing dirty harness worktree before creating its modification allow-list; approach was designed but not applied or tested | |
| 2 | gpt-5.6-sol / try-fix |
Handler-lifetime subscription gating: attach ordinary strong root delegates only while a handler is connected and detach them on handler change | 0 files | Consumed candidate 1's result and selected a different mechanism, but the same mandatory baseline guard prevented implementation and testing | |
| PR | PR #37868 | Finalizable subscription holder using weak proxies for all three root events | ✅ PASSED (Gate) | 1 implementation, 1 test | Original PR; gate already proved red without fix and green with fix |
Candidate 1 Narrative
Approach: Replace direct root-to-view event delegates with one private relay object. The shared root may retain the relay, but the relay holds only a WeakReference<TableView>, so the strong graph cannot retain the view or its binding context. A dead relay lazily unsubscribes on the next event.
Prior approach avoided: The PR stores weak handler delegates in three WeakEventProxy instances held by a finalizable subscription owner. Candidate 1 instead weakens the relay-to-view edge and requires neither a finalizer nor WeakEventProxy infrastructure.
Result: Blocked before implementation. EstablishBrokenBaseline.ps1 stopped at its clean-tree guard because of pre-existing .github/** and eng/scripts/** harness changes. It created no .github/.baseline-state.json, so the try-fix allow-list did not exist and editing was prohibited. No test was run because HEAD still contained the PR fix and would have produced a false pass.
Diff: Empty.
Self-review: 0 findings; empty-diff review recorded as [].
Restore: No baseline state existed and no attempt edit occurred; -Restore reported Restored: False / No baseline state found, the accepted no-state blocked path.
Detailed report: ../try-fix-1/content.md
Candidate 2 Narrative
Approach: Tie the three ordinary strong TableRoot subscriptions to the TableView handler lifecycle. A never-connected view would not subscribe; handler connection would attach callbacks, root replacement would move active callbacks, and handler disconnection would detach them deterministically.
Prior approaches avoided: Unlike the PR, candidate 2 uses no weak proxies or finalizer. Unlike candidate 1, it creates no root-retained relay and no weak target. It instead removes the subscription graph entirely outside the connected-handler lifetime.
Result: Blocked before implementation. After reading candidate 1's recorded result and choosing a different mechanism, the required baseline command encountered the same pre-existing harness worktree changes and exited before creating .github/.baseline-state.json. No test was run because HEAD still contained the PR fix.
Diff: Empty.
Self-review: 0 findings; empty-diff review recorded as []. The unapplied design would require future behavioral validation because gating subscriptions by handler state could alter pre-handler model notifications.
Restore: No baseline state existed and no attempt edit occurred; -Restore reported Restored: False / No baseline state found, the accepted no-state blocked path.
Detailed report: ../try-fix-2/content.md
Failure Analysis
Both invocations were bounded, sequential, and completed without touching source. The mandatory EstablishBrokenBaseline.ps1 clean-tree guard rejected pre-existing modified and untracked harness files under .github/** and eng/scripts/**. The execution contract prohibited staging, hiding, stashing, committing, deleting, restoring, or otherwise bypassing those changes. Because neither invocation received a baseline state or RevertedFiles allow-list, applying either candidate would have violated restoration safety and testing HEAD would only have retested the PR fix.
Cross-Pollination
Skipped by the STEP 5a execution contract.
Exhausted: Yes — the two-candidate STEP 5a limit is reached; both alternatives are blocked and unvalidated.
Selected Fix: PR #37868 — it is the only empirically validated implementation (Gate passed). Candidate 1 is a plausible finalizer-free alternative but has no diff or test evidence; candidate 2 is also unvalidated and risks changing pre-handler notification semantics.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the description is detailed and accurate, but the title uses a workflow-noise prefix instead of identifying this as a cross-platform TableView change, and the description omits two notification behavior changes already present in PR HEAD.
Recommended title
[All] TableView: Prevent Root event subscriptions from retaining the view
Recommended description
> [!NOTE]
> 🤖 **AI-generated PR** — produced automatically by the **Memory Leak Fixer** agentic workflow from issue #37634. The regression test below was observed to FAIL on unpatched `main` and PASS with this fix, on the runner. Please review carefully before merging.
Fixes #37634
Refs: dotnet/maui#37634
Target branch: main
Attempt: 1/3
## The leak
`TableView.Root` subscribed the view directly to a shared `TableRoot` through `CollectionChanged`, `SectionCollectionChanged`, and `PropertyChanged` handlers in `src/Controls/src/Core/TableView/TableView.cs`. Because those event delegates targeted the `TableView` and were removed only when `Root` changed, a long-lived root retained a discarded view and its binding context.
## The fix
Centralize root event wiring in a private finalizable subscription holder and route all three notifications through weak proxies. The shared `TableRoot` now retains only proxies with weak handler references, while the holder keeps delegates alive for the lifetime of the `TableView` and detaches the proxies during finalization.
Consolidating the subscriptions also makes constructor-supplied roots notify the view when their title changes and removes the duplicate `SectionCollectionChanged` subscription previously created through the `Root` setter.
## Regression test
`TableViewUnitTests.SharedRootDoesNotRetainTableView` in `src/Controls/tests/Core.UnitTests/TableViewUnitTests.cs`. It assigns a long-lived `TableRoot` to a `TableView`, drops the view, forces GC, and asserts the view is collected while keeping the root alive.
| State | Result |
|---|---|
| Without fix (unpatched `main`) | ❌ test FAILS (control retained) |
| With fix | ✅ test PASSES (control collected) |
Red: `SharedRootDoesNotRetainTableView [FAIL]` — `TableView should not be alive!`
Green: `Passed SharedRootDoesNotRetainTableView [47 ms]`
## Scope
Managed cross-platform change in `src/Controls/src/Core/TableView/TableView.cs` → all platforms. No public API change.
> Generated by [Memory Leak Fixer](https://github.com/dotnet/maui/actions/runs/33031992748) · gpt56 · 147.2 AIC · ⌖ 66.2 AIC · ⊞ 41.1K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+leak-fixer%22&type=pullrequests)
<!-- gh-aw-agentic-workflow: Memory Leak Fixer, engine: copilot, model: gpt-5.6-sol, id: 33031992748, workflow_id: leak-fixer, run: https://github.com/dotnet/maui/actions/runs/33031992748 -->
<!-- gh-aw-workflow-id: leak-fixer -->
<!-- gh-aw-workflow-call-id: dotnet/maui/leak-fixer -->
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winning candidate: pr-plus-reviewer
pr-plus-reviewer is the strongest candidate because it preserves the submitted PR's sound weak-proxy fix, addresses the expert review's actionable coverage and cleanup findings, and passes the focused validation with 2 passed, 0 failed. The submitted PR is functionally correct and passed the trusted Gate, but the winning refinements are not yet in PR HEAD.
Comparative ranking
| Rank | Candidate | Implementation evidence | Regression evidence | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Submitted weak-proxy mechanism plus populated leak coverage, notification behavior coverage, and dead-field removal | ✅ Focused candidate validation: 2 passed, 0 failed | Winner. Covers the real section/cell graph and pins all three weak-proxy notification paths, including exactly-once section notification and constructor-supplied root title changes. |
| 2 | pr |
Finalizable subscription holder routes all three TableRoot events through weak proxies |
✅ Trusted Gate passed: regression test fails without the fix and passes with it | Correct leak fix with no expert-review blocker, but its empty-root test does not exercise the section/cell graph or prove notifications remain live; _parent is dead state. |
| 3 | try-fix-1 |
Weak-target relay was designed but never materialized; candidate diff is empty | Plausible finalizer-free mechanism, but there is no implementation or empirical evidence. Lazy cleanup would also leave dead relays attached until a later event. | |
| 4 | try-fix-2 |
Handler-lifetime subscription gating was designed but never materialized; candidate diff is empty | Unvalidated and carries greater semantic risk because pre-handler model notifications would no longer be delivered. |
No candidate failed a regression test. The two blocked STEP 5a candidates rank below both passing candidates because they have no diff and no validation evidence.
Expert review reconciliation
The expert reviewer found the submitted reference graph and lifecycle sound: the shared root retains proxy objects, each proxy weakly references the TableView, the holder roots handler delegates for the view lifetime, root swaps remain symmetric, and finalizer cleanup follows the repository's established WeakEventProxy convention.
The consolidated reviewer patch addresses the meaningful non-blocking findings:
- Exercises a populated shared root in the leak regression.
- Verifies collection, section, and root-property notifications still flow through the weak proxies.
- Pins exactly one notification for a section mutation and title notification for a constructor-supplied root.
- Removes the unused
TableSectionModel._parentfield.
Moving the specialized proxy into the shared proxy file was intentionally omitted as cosmetic churn.
Required action
Apply pr-plus-reviewer/reviewer.patch to the PR branch. The raw PR should not be approved until those winning changes are submitted.
📱 UI Tests — TableView
Detected UI test categories: TableView
✅ Deep UI tests — 18 passed, 0 failed across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
TableView |
18/18 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The submitted weak-proxy fix is sound and Gate-validated, but pr-plus-reviewer adds passing coverage for the populated object graph and all notification paths while removing dead state. The two try-fix alternatives were blocked before implementation or testing.
Address the actionable findings in this review before merging.
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!
Note
🤖 AI-generated PR — produced automatically by the Memory Leak Fixer agentic workflow from issue #37634. The regression test below was observed to FAIL on unpatched
mainand PASS with this fix, on the runner. Please review carefully before merging.Fixes #37634
Refs: #37634
Target branch: main
Attempt: 1/3
The leak
TableView.Rootsubscribed the view directly to a sharedTableRootthroughCollectionChanged,SectionCollectionChanged, andPropertyChangedhandlers insrc/Controls/src/Core/TableView/TableView.cs. Because those event delegates targeted theTableViewand were removed only whenRootchanged, a long-lived root retained a discarded view and its binding context.The fix
Centralize root event wiring in a private finalizable subscription holder and route all three notifications through weak proxies. The shared
TableRootnow retains only proxies with weak handler references, while the holder keeps delegates alive for the lifetime of theTableViewand detaches the proxies during finalization.Regression test
TableViewUnitTests.SharedRootDoesNotRetainTableViewinsrc/Controls/tests/Core.UnitTests/TableViewUnitTests.cs. It assigns a long-livedTableRootto aTableView, drops the view, forces GC, and asserts the view is collected while keeping the root alive.main)Red:
SharedRootDoesNotRetainTableView [FAIL]—TableView should not be alive!Green:
Passed SharedRootDoesNotRetainTableView [47 ms]Scope
Managed cross-platform change in
src/Controls/src/Core/TableView/TableView.cs→ all platforms. No public API change.