Repository navigation
Description
Current behavior
When calling .AddAsync(uri,ct), where Uri has the value of https://platform.uno/studio/ at this time, on a ListState<Uri>.Async( ... .Selection(AnyUriState) the AnyUriState.Empty(this).ForEach( Operator callback handler should not get called with null AND THEN with the expected Value of https://platform.uno/studio/
seems a bit like the .Empty(this) might be resetting it? but should not be the case...
Expected behavior
The ForEach Operator Callback handler should only get called with the value that has been added + selected!
How to reproduce it (as minimally and precisely as possible)
Repro: UnoWebViewReproApp1.zip
- Start the app, it will show you MainPage
- If not preserved, go into MainModel and set Breakpoints on
HistorySelectionChangedCallback Handler 1. Line (logger)CurrentUrlChangedin theAddAsyncandTrySelectAsyncLines relativly on the bottom area of the method
- now in the WebView2, which is showing the Uno Homepage, click on
Platformin the Head Navigation (most likly you will need to use the Hamburger Icon before, since we are not able to Have the WebView2 Resized automatically on Window resizing) so you will get Navigated to this page - check out the Console, which should be containing this MainModel Log lines:
this output would be alright!
info: UnoWebViewReproApp1.Presentation.MainModel[0] CurrentUrlChanged Adding https://platform.uno/platform/ to NavigationHistory info: UnoWebViewReproApp1.Presentation.MainModel[0] CurrentUrlChanged Selected https://platform.uno/platform/ in NavigationHistory warn: UnoWebViewReproApp1.Presentation.MainModel[0] HistorySelectionChanged Got parameter: https://platform.uno/platform/, this is type of: Uri info: UnoWebViewReproApp1.Presentation.MainModel[0] HistorySelectionChanged Selected Uri from CurrentUrl: https://platform.uno/platform/ - now click again on the Homepage on
Studioto get navigated to this. - Inspecting the Console output now will show you the issued Behaviour in the third logged entry:
info: UnoWebViewReproApp1.Presentation.MainModel[0] CurrentUrlChanged Adding https://platform.uno/studio/ to NavigationHistory info: UnoWebViewReproApp1.Presentation.MainModel[0] CurrentUrlChanged Selected https://platform.uno/studio/ in NavigationHistory warn: UnoWebViewReproApp1.Presentation.MainModel[0] HistorySelectionChanged Got parameter: (null), this is type of: (null) warn: UnoWebViewReproApp1.Presentation.MainModel[0] HistorySelectionChanged Got parameter: https://platform.uno/studio/, this is type of: Uri info: UnoWebViewReproApp1.Presentation.MainModel[0] HistorySelectionChanged Selected Uri from CurrentUrl: https://platform.uno/studio/ - I added the mentioned Breakpoints and found out that we are getting the null value argument, even if its set to not nullable Uri type and on clicking continue, it gets a second call (we did only call Selection once if you inspect the code:
public IListState<Uri> WebNavigationHistory => ListState<Uri>.Async(this, async ct => { var current = await CurrentUrl; return current is not null ? [current] : []; }) .Selection(SelectedNavigationHistoryItem); public IState<Uri> SelectedNavigationHistoryItem => State<Uri>.Empty(this) .ForEach(HistorySelectionChanged);
closely inspecting the logger lines producement order:
- when we are calling
AddAsyncthe value is not null then the valid url. - the
HistorySelectionChangedgets called withnullargument and loggs its initial line - Debugger steps to
CurrentUrlChanged > TrySelectAsync - Debugger steps to
HistorySelectionChanged >if statementwith null value, so does not enter the statement and leaves the method - Now we seem to proceed reacting on
TrySelectAsyncand getting send to theHistorySelectionChangedwith this call (again) and et voila, now we do have the value in the call and getting the appropriate reaction of logging with the url UpdateAsyncnow gets called (and the debugger switches back and forth again) and our code proceedes as expected WITH the values instead of null.
Environment
For bug reports Check one or more of the following options with "x" (???)
VS 2026 Windows
Nuget Package (s):
Package Version(s):
Uno.Sdk first discovered as issue with MvuxListApp Repro using 6.3.28
still an issue with 6.4.13
Affected platform(s):
- iOS
- macOS (AppKit)
- Mac Catalyst
- Android
- WebAssembly
- Windows
- Desktop
- Skia (Linux Framebuffer)
- Build tasks
Visual Studio:
- 2019 (version: )
- 2022 (version: )
- 2026 (version: 18.0.0)
- Visual Studio Code (version: )
- Rider Windows (version: )
- Rider macOS (version: )
Relevant plugins:
- Resharper (version: )
Anything else we need to know?
mentioned this null value introduction in #2927 in which sample the connected TextBox to the Selected Item does NOT show any value and seems to stay on the null value instead of getting updated with the secondary call 🤔
Repro for this:
MvuxListApp.zip
hoping that anyone could have this fixed in the Reactive Packages of uno...
Activity
kazo0 commentedon Nov 13, 2025
@dr1rrb FYI
test: Add tests for AddAsync + TrySelectAsync scenario
DevTKSS commentedon Nov 30, 2025
@kazo0 @dr1rrb FYI:
Still issued with Uno.Sdk version
6.4.31DevTKSS commentedon Dec 11, 2025
@dr1rrb @kazo0 seems like the fixing PR just needs to get merged, but Copilot didn't sign the Contribution Licensing 🤣 could you check up with him to get it throught? with the WebView2 fix applyed in the latest pre this would be the last rock to roll to finally get my Tutorial published about using WebView2 in Uno with Mvux 🚀
kazo0 commentedon Dec 12, 2025
@DevTKSS Merged! Please let me know if you are still seeing an issue with this change. The -dev package containing the fix should be available in a few hours
DevTKSS commentedon Dec 12, 2025
@kazo0 Thanks! finally no longer
this is type of 'null'🎉Hoping the HD team will now check whats up with WebView2 in the latest Uno.Sdk Dev Build which doesn't show up any longer but at least resizes 😅