Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] When navigating, the view is sometimes different from the ViewModel #7610

Open
pdecostervgls opened this issue Dec 7, 2021 · 7 comments
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)

Comments

@pdecostervgls
Copy link

Current behavior

After upgrading to Uno 3.11.6 we noticed a regression in the navigation flow. Our app suddenly decided to show the view of a entirely different page than was navigated towards, but the ViewModel was correct.
We reproduced this issue in our earlier used "deconstructed" version of the app, because we are confident that the issue lies in the configuration of our app, therefore a clean reproducable project was not created.

Observe the following .GIF demonstrating the issue.
navigation_glitch

  • First we show the app and its "greek" pages independently
  • Then we navigate back the page before the settings page
  • Upon getting to the settings page, we show the Support page again, which is shown fine
  • But when we open the Alpha page, we see the beta symbol, even though the CommandBar title and VM is correct.
  • This happens with all other pages after that, until even the Delta page starts showing the contents of the settings page

Expected behavior

The loaded view should correspond to the requested page.

How to reproduce it (as minimally and precisely as possible)

As stated before, for hunting this issue down we used the stripped down "Deconstructed" version of our actual app. This should prove to be sufficient.

(project zip will be included once I can upload it on GitHub)

Workaround

No response

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

Uno.UI: 3.11.6

Affected platforms

iOS

IDE

Visual Studio 2022

IDE version

17.0.1

Relevant plugins

No response

Anything else we need to know?

No response

@pdecostervgls pdecostervgls added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Dec 7, 2021
@jeromelaban
Copy link
Member

Thanks for the report.

Can you try adding the following : FrameworkTemplatePool.IsPoolingEnabled = false; in your app.xaml.cs and see if this helps ?

@pdecostervgls
Copy link
Author

@jeromelaban Seems to have resolved it, seems its a bug in the pooling then?

@jeromelaban
Copy link
Member

It's not necessarily a bug in the pooling, but rather with controls that are not aware that they can be reused. This is generally a problem if the content being reused if modified explicitly through code (instead of bindings).

Do you know what part of the UI is being incorrect ?

@pdecostervgls
Copy link
Author

In my example, the entire page. The "Bound VM" is correct because in all cases it refers to {Binding}

@jeromelaban
Copy link
Member

This could mean that the constructor is not invoked because the page or some of its contents is reused. Do you initialize the datacontext in the constructor by any chance ?

@pdecostervgls
Copy link
Author

Not that I am aware of. The datacontext is being set in the XAML with DataContext="{Binding Alpha, Source={StaticResource Locator}}". Where Locator is of type ViewModelLocator

@jeromelaban
Copy link
Member

We've made changes around pooling, which may have fixed this issue. If that's the case, let us know.

@MartinZikmund MartinZikmund added project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...) difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)
Projects
None yet
Development

No branches or pull requests

3 participants