ReactiveUI: [BUG] Router.NavigateBack is still broken in some cases
Describe the bug
This is related to https://github.com/reactiveui/ReactiveUI/issues/2286 and https://github.com/reactiveui/ReactiveUI/pull/2315, with some more test cases
Steps To Reproduce
Sample: Test.zip
The sample is based on the one provided by https://github.com/reactiveui/ReactiveUI/issues/2286
There are three cases (all can be found inside ItemViewModel):
NavigateBackinsideSubscribevar completedInternally = Observable.Amb( Confirm.Select(_ => _), Cancel.Select(_ => _), Delete.Select(_ => _)); completedInternally.Subscribe(_ => { if (HostScreen.Router.NavigationStack.LastOrDefault() == this) { HostScreen.Router.NavigateBack.Execute().Subscribe(); if (NextViewModel != null) HostScreen.Router.Navigate.Execute(NextViewModel).Subscribe(); } });NavigateBackinsideSelectManyvar completedInternally = Observable.Amb( Confirm.Select(_ => _), Cancel.Select(_ => _), Delete.Select(_ => _)) .Where(_ => HostScreen.Router.NavigationStack.LastOrDefault() == this) .SelectMany(_ => HostScreen.Router.NavigateBack.Execute()); completedInternally.Subscribe(_ => { if (NextViewModel != null) HostScreen.Router.Navigate.Execute(NextViewModel).Subscribe(); });NavigateBackinsideDovar completedInternally = Observable.Amb( Confirm.Select(_ => _), Cancel.Select(_ => _), Delete.Select(_ => _)) .Where(_ => HostScreen.Router.NavigationStack.LastOrDefault() == this) .Do(_ => HostScreen.Router.NavigateBack.Execute().Subscribe()); completedInternally.Subscribe(_ => { if (NextViewModel != null) HostScreen.Router.Navigate.Execute(NextViewModel).Subscribe(); });
| Case | RxUI 11.1.11 | RxUI 11.1.6 |
|---|---|---|
| 1 | ✔ | ❌ |
| 2 | ❌ | ❌ |
| 3 | ✔ | ❌ |
Expected behavior
It should return to the Main Page when Save is tapped on the Production page.
Environment
- OS: Android 7-API 24, physical device
- Version 11.1.11 and 11.1.6
- Device: Samsung S6
Additional context
I’m quite new to ReactiveUI (using this for my uni’s final year project), so it might the case that I am using it all wrong.
Thanks!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (11 by maintainers)
@garyng No apologies needed. I am digesting all the words and trying to find the sense in all this. Thank you for all the details. I will plug all this in and run some more tests. I am almost wondering if the previous change did anything, or just made it worst.
I think I fixed it… But I’m not sure… forgive me for pasting it here because I have to submit my assignment later 😅
Bufferfor a sliding window onNavigationStackcount changes