Skip to content

Order of calling Shell.Navigated and ApplyQueryAttributes changes/is inconsistent #29645

@bzd3y

Description

@bzd3y

Description

The order in which Shell.Navigated and ApplyQueryAttributes are called changes depending on the type of navigation.

I suspect this might be related to one or more of following issues, so sorry if this is a duplicate.

#28453
#29428
#29272

Steps to Reproduce

  1. Clone the reproduction project repository
  2. Run the app
  3. Put breakpoints on AppShell.NavigatedTo and the ApplyQueryAttributes for the two pages in the project
  4. OtherPage should be the current Shell item. Click the "Click me" button to navigate to MainPage.
  5. Observe that Shell.Navigated is called and then MainPage.ApplyQueryAttributes is called (this seems wrong, but if it was consistent then it would be acceptable)
  6. Click the "Click me" button on MainPage to navigate back to OtherPage
  7. Observe that now ApplyQueryAttributes is called first and then Shell.Navigated is called, presumably because an OtherPage has already been instantiated and is being reused.
  8. Now, open the flyout menu and select the second item titled something like "Title:...".
  9. Observe that ApplyQueryAttributes now gets called with the same query parameters provided in step 4 above, followed by Shell.Navigated. Note that this happens even if the flyout item for MainPage is already the current item, except that in that case Shell.Navigated is NOT called (which probably makes sense).
  10. Open the flyout menu and click the first item titled "Other" and observe that ApplyQueryAttributes is NOT called, despite it being provided query parameters in step 6 above (presumably because the instance being used was instantiated without query parameters when the app started?).

Link to public reproduction project repository

https://github.com/bzd3y/ShellContentOrderBug

Version with bug

9.0.70 SR7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-shellShell Navigation, Routes, Tabs, Flyoutplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions