reactiveui / ReactiveUI

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
https://www.reactiveui.net
MIT License
7.99k stars 1.12k forks source link

[Bug]: NavigateAndReset doesn't work in first view #3820

Open RobinSrs opened 1 month ago

RobinSrs commented 1 month ago

Describe the bug 🐞

In later versions of ReactiveUi (it works in 19.5.1, but not in 20.1.1) the navigation doesn't work properly.

This is related to the following fix: https://github.com/reactiveui/ReactiveUI/commit/14821ae2a16d9173b3abc93f7c3c877106a09158, which was related to problem: https://github.com/reactiveui/ReactiveUI/issues/3640

Some context: We have recently started to migrate our ReactiveUi application from xamarin to maui, and noticed that the NavigateAndReset function didn't work in the first view anymore, and have encountered similar problems with the Navigate function elsewhere. Simply put: one can call the function, but nothing happens. This is because the where clause of the fix prohibits the execution of it.

Step to reproduce

  1. Run the project listed here: https://github.com/RobinSrs/ReactiveUITestProject in an android emulator or device.
  2. Press one of the two flag buttons.
  3. You see a spinner appear, but nothing happens (the navigate and reset function doesn't work)
  4. Uninstall ReactiveUI.Maui with the nuget manager, Install version 19.5.1
  5. Run again, press one of the two buttons
  6. You have now successfully navigated to a new page.

Reproduction repository

https://github.com/RobinSrs/ReactiveUITestProject

Expected behavior

In all versions of the ReactiveUI, the Navigate and NavigateAndReset functions should work at any time it is called.

Screenshots 🖼️

https://github.com/reactiveui/ReactiveUI/assets/52996438/ffe812e8-dc7b-4957-8930-33d3022b7091

IDE

No response

Operating system

Android

Version

No response

Device

No response

ReactiveUI Version

20.1.1

Additional information ℹ️

No response

ChrisPulman commented 1 month ago

@RobinSrs Thank you for raising this issue and sorry to hear it's not working as expected, I will take a look this week and look into resolving this issue.

RobinSrs commented 1 month ago

@ChrisPulman

Do you have any updates on this issue?

anaisbetts commented 1 month ago

@RobinSrs Keep in mind that you can always copy-paste src/ReactiveUI.Maui/RoutedViewHost.cs into your app, and change it however you want, you don't need to wait for ReactiveUI to make a release. This goes for nearly every aspect of the framework, you can almost always make your own version of $SOMETHING and register over the built-one

RobinSrs commented 1 month ago

Hi @anaisbetts

I am aware of that, and have done something very similar to make it work in our application :) There isn't a high priority for us, but I was still curious if there were any updates on this issue.