Repository navigation
fix(navigation): follow-ups to #3249 — test host without Navigation.WinUI, case-insensitive name match, docs - #3254
Merged
Merged
Conversation
kazo0
marked this pull request as ready for review
October 16, 2026 15:36
Contributor
|
|
Contributor
Author
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
kazo0
force-pushed
the
dev/sb/3248-test-host
branch
from
October 19, 2026 16:36
81faf0b to
746cbe8
Compare
Contributor
|
|
kazo0
enabled auto-merge
October 26, 2026 15:21
Contributor
|
|
Xiaoy312
approved these changes
Oct 26, 2026
Xiaoy312
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The extraction is clean and the case-insensitive fix comes with a test that catches it. The main point is the first inline comment: the resolver's own wiring is no longer covered. The rest are small nits or follow-ups on older behaviour, none of them blocking.
…ithout Navigation.WinUI - Move the load-context assembly selection and the by-name type index out of RouteResolverDefault into the UI-free internal RouteTypeIndex; move the public AssemblyExtensions to its own file, unchanged - Compile RouteTypeIndex.cs and AssemblyExtensions.cs into Uno.Extensions.Navigation.Tests instead of referencing Navigation.WinUI, as Authentication.MSAL.Tests does, so the project no longer needs Uno.WinUI, the $(UnoVersion) read from global.json, or the UNOB0025 override - Test RouteTypeIndex directly (Given_RouteTypeIndex): other-context isolation, own-context precedence (also proves ToDictionaryDistinct keeps the first entry), and skipping the default copy of an assembly the own context has - Give the emitted default-context assembly and types unique names per run, since the default context never unloads - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DfEL4A7BqL6zLvko22CdCA
- The loader treats assembly simple names case-insensitively, so a default-context assembly whose name differs from an own-context one only in casing is the same assembly and must be skipped like any other default copy - When_AssemblyAlsoInOwnLoadContextWithOtherCasing_Then_DefaultCopyIgnored fails with the previous ordinal comparison - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DfEL4A7BqL6zLvko22CdCA
…ches - Since #3248, a route without a registered view is resolved by name only from the load context that loaded Uno.Extensions.Navigation and the default one; views in any other AssemblyLoadContext (e.g. Assembly.LoadFile) need an explicit ViewMap/RouteMap Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DfEL4A7BqL6zLvko22CdCA
…-context isolation - Move the own-context choice (GetLoadContext(anchor) ?? Default) into RouteTypeIndex.OwnContextOf so the tests reach it; every Given_RouteTypeIndex case now builds the index from an anchor assembly, as RouteResolverDefault does - Add When_TypeOnlyInSiblingLoadContext_Then_NotIndexed: the resolver's own context and another app's context are both alive, and the other's types stay out of the index - Assert the own copy is still indexed in the casing test - Returning the default context from OwnContextOf fails 4 tests; also indexing sibling contexts fails the new test - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01S4VxjrUrcGVoeBhEjXrmpo
… lookup searches - The resolver anchors on Uno.Extensions.Navigation.UI (package Uno.Extensions.Navigation.WinUI), not the core Uno.Extensions.Navigation assembly Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01S4VxjrUrcGVoeBhEjXrmpo
…rop ToDictionaryDistinct - RouteTypeIndex.For(anchor) picks the anchor's load context and builds the index; RouteResolverDefault.LoadedTypes and Given_RouteTypeIndex both call it, so the tests exercise the resolver's own wiring rather than a copy of it - Build the index with Dictionary.TryAdd instead of ToDictionaryDistinct: the shipped library got that helper from Uno.Core.Extensions 4.1.1 while the tests got it from Uno.Core.Extensions.Collections 5.0.0-dev.34, so the tests proved keep-first on a different binary; both keep the first entry, so behaviour is unchanged - Drop the Uno.Core.Extensions.Collections reference from Uno.Extensions.Navigation.Tests and warn in the csproj that referencing Navigation.WinUI would define the linked AssemblyExtensions twice (CS0436) - Trim the production remark to the constraint it guards, and say why both casings can load in the casing test - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN
- LoadedTypes used an unsynchronised null check, so two concurrent first lookups on a multi-threaded head could both run the full GetTypes() scan; build it with LazyInitializer.EnsureInitialized instead, as specs/lessons.md asks for shared memoisation - Lock AssemblyExtensions.Excludes while the index reads it and while SafeGetTypes adds to it, so concurrent index builds don't corrupt the list; WASM is single-threaded, so the lock is never contended there - No deterministic test: the race needs two threads to interleave inside the first lookup - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN
…artly fail to load - SafeGetTypes caught everything and excluded the whole assembly for the rest of the process, so one class referencing a missing optional package hid every page and view model in its assembly from implicit routing, with nothing logged - Catch ReflectionTypeLoadException first and keep the types it did load, without excluding the assembly; any other failure still excludes it as before - RouteTypeIndex reports each failure, and RouteResolverDefault logs it as a structured warning carrying the exception and its loader exceptions - The public SafeGetTypes signature is unchanged; the error comes out through an internal overload - When_SomeTypesFailToLoad_Then_LoadableTypesIndexed fails with the previous catch-all - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN
…te doesn't resolve - Since #3249, a view in another AssemblyLoadContext no longer resolves by name, but the warning read the same as a typo, and the scope was only logged at Debug - The "Could not resolve type for path" warning now says which load contexts were searched and that types elsewhere need an explicit ViewMap/RouteMap - Add Given_RouteResolverDefault in Navigation.UI.Tests: through the resolver itself, a view model loaded only into another load context does not resolve, one in the resolver's own context does, and the warning names the searched contexts; making the index scan every assembly in the process fails it - Gated to desktop, like the repo's other emitted-assembly tests; no CI lane runs Navigation.UI.Tests today (the desktop lane's RuntimeTestsFilter leaves it out and the skia !_HotReload stage is disabled), so it was run locally on the desktop head - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN
… lookup skips - XML docs for the public AssemblyExtensions, Excludes (including the lock navigation takes on it) and SafeGetTypes - HowTo-DefineRoutes.md: the type index is built once, at the first lookup; it skips a default-context assembly when the first load context has one with the same name, assemblies whose name starts with `_`, and types that fail to load; any of these needs an explicit ViewMap/RouteMap - Part of #3248 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN
kazo0
force-pushed
the
dev/sb/3248-test-host
branch
from
October 27, 2026 14:37
2613bdd to
83deade
Compare
…use Where' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
4 of 6 tasks
agneszitte
pushed a commit
that referenced
this pull request
Nov 3, 2026
- The docs validation only runs for PRs that touch a .md file. This PR does (HowTo-DefineRoutes.md, from #3254), so it fails on 7.3 files it didn't change - Same fix as main's ec84019 (from #3153): MD040 in specs/004 and specs/006, "nuspecs" and "unmaterialized" in the dictionary, "recognize" in specs/lessons.md, MD059/MD060 off - Also adds "rehook" (specs/009), which main got with #3154 (cherry picked from commit ec84019) Co-Authored-By: Claude Opus 5.5 <[email protected]>
agneszitte
added a commit
that referenced
this pull request
Nov 3, 2026
… tests use - Given_RouteResolverDefault (#3254) logs through CapturingLoggerProvider. main got that helper with #3231, which 7.3 doesn't have - Copied as is from main: test project only, no product change Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 of 7 tasks
agneszitte
added a commit
that referenced
this pull request
Nov 3, 2026
…e whole route (backport #3231) - Backport of #3231 to servicing/7.4, applied without changes - Also moves CapturingLoggerProvider to its own file, which the #3254 tests use Co-Authored-By: Claude Opus 5.5 <[email protected]>
agneszitte
added a commit
that referenced
this pull request
Nov 3, 2026
…nUI, case-insensitive name match, docs (backport #3254) - Backport of #3254 to servicing/7.4, applied without changes Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
GitHub Issue (If applicable): related to #3248 (follow-up to #3249)
PR Type
What is the current behavior?
Follow-ups from the review of #3249:
Uno.Extensions.Navigation.TestsreferencesUno.Extensions.Navigation.WinUI. To make that load in a plain test host, the csproj reads$(UnoVersion)out ofglobal.jsonwith a regex and disablesUNOB0025.RouteResolverDefaultcompares assembly simple names ordinally when it skips default-context copies of assemblies the resolver's own context already has. The loader compares them case-insensitively.Found while reviewing this PR (most predate it):
AssemblyExtensions.SafeGetTypescatches everything and excludes the whole assembly when one type fails to load, without logging anything.LoadedTypesandAssemblyExtensions.Excludesare not safe when two first lookups run concurrently.What is the new behavior?
RouteTypeIndex.RouteTypeIndex.For(anchor), which bothRouteResolverDefault.LoadedTypesand the tests call.Dictionary.TryAdd(keep first), notToDictionaryDistinct.RouteTypeIndex.csandAssemblyExtensions.csin directly, asAuthentication.MSAL.Testsdoes. That removes the Navigation.WinUI reference, theglobal.jsonregex, theUNOB0025override, and any extra package reference.OrdinalIgnoreCase.ReflectionTypeLoadException), the types that did load are still indexed, and a structured warning is logged.LazyInitializer). Reads of and additions toExcludestake a lock.ViewMap/RouteMap.HowTo-DefineRoutes.mdexplains which load contexts implicit lookup searches. It also says the index is built once, at the first lookup, and lists what the lookup skips.AssemblyExtensionsgains XML docs.PR Checklist
Uno.Extensions.Navigation.Testspasses 7/7 in Release withbuild/tests.runsettings.Given_RouteResolverDefault | Given_NavigationRouteUpdateHandler.Uno.Extensions.Navigation.WinUIbuilds in Release fornet10.0locally. The android and ios workloads aren't installed on the machine used, and the Windows target needs msbuild, so CI covers those.RouteTypeIndexis internal.AssemblyExtensionsmoved to its own file in the same assembly and namespace, and its public signatures are unchanged.SafeGetTypesnow returns the loadable types of a partly loadable assembly instead of an empty array.Other information
Given_RouteResolverDefault(Navigation.UI.Tests) is gated to desktop. No CI lane runs Navigation.UI.Tests today: the desktop lane'sRuntimeTestsFilterleaves it out, and the skia!_HotReloadstage is disabled. It was run locally on the desktop head.Given_RouteResolverDefault.SafeGetTypesfailsWhen_SomeTypesFailToLoad_Then_LoadableTypesIndexed.typeof(RouteResolverDefault).Assemblyanchor in a host where the resolver lives outside the default context.🤖 Generated with Claude Code
https://claude.ai/code/session_01DfEL4A7BqL6zLvko22CdCA
https://claude.ai/code/session_01S4VxjrUrcGVoeBhEjXrmpo
https://claude.ai/code/session_01PZQ75nMpDZr9xNdRwacVQN