$query not updating when switching pages from navigation

Product: PowerShell Universal
Version: 4.2.21

Test code here

$Navigation = @(
    New-UDListItem -Label "All" -href '/home'
    New-UDListItem -Label "01" -Href '/home?site=01'
    New-UDListItem -Label "02" -Href '/home?site=02'
    New-UDListItem -Label "03" -Href '/home?site=03'
)
New-UDApp -Title "component test dash" -NavigationLayout Permanent -Navigation $Navigation -Content {

  new-udbutton -text "click" -OnClick {
      show-udtoast -message "$($query["site"])"
      $query["site"] | out-file C:\Temp\site.txt -append
  }

}

When first going to the root /home page $query is empty, as expected, but when clicking on one of the navigation options the URL updates, but $query does not.

If I load the page with the site specified in the URL (/home?site=01) it works, but when switching to a different page from the navigation (/home?site=02) it doesn’t update $query, stays at what the page loaded as.

I feel like this is new. The page worked fine previously, can’t remember the version of Universal it was built on though. Could be related to this?

I also believe this is new because I experienced the same thing. Once I added the full URL it started working again.

from:

New-UDListItem -Label $item.label -Href "/home?license=$($item.file)" -SubTitle $item.Subtitle

to:

New-UDListItem -Label $item.label -Href "$homeurl/home?license=$($item.file)" -SubTitle $item.Subtitle

$homeurl depends on dev or production server, so now I have to check this where I didn’t prior. I believe this happened when I upgraded to 4.2.20.

4.2.20 seemed to be when it happened to me as well. I don’t recall what version I was on prior to that. I feel like it was .16 or .17 though

I switched to this, using the built in $appfullurl variable, and still have the same issue.

$Navigation = @(
    New-UDListItem -Label "All" -href "$appfullurl/home"
    New-UDListItem -Label "01" -Href "$appfullurl/home?site=01"
    New-UDListItem -Label "02" -Href "$appfullurl/home?site=02"
    New-UDListItem -Label "03" -Href "$appfullurl/home?site=03"
)
New-UDApp -Title "component test dash" -NavigationLayout Permanent -Navigation $Navigation -Content {

    new-udbutton -text "click" -OnClick {
        show-udtoast -message "$($query["site"])"
        $query["site"] | out-file C:\Temp\site.txt -append
    }
}

switching out $appfullurl with a variable made in page for the base URL and that seems to work.

$url = "https://universal.domain.local/comptest"

$Navigation = @(
    New-UDListItem -Label "All" -href "$url/home"
    New-UDListItem -Label "01" -Href "$url/home?site=01"
    New-UDListItem -Label "02" -Href "$url/home?site=02"
    New-UDListItem -Label "03" -Href "$url/home?site=03"
)
New-UDApp -Title "component test dash" -NavigationLayout Permanent -Navigation $Navigation -Content {

    new-udbutton -text "click" -OnClick {
        show-udtoast -message "$($query["site"])"
        $query["site"] | out-file C:\Temp\site.txt -append
    }
}

Looks like there are two issues I found. The query parameter not working correctly, and $appfullURL not working. Unless $appfullURL is only good on the built in docs page where I found it.

I do not believe $AppFullUrl and other system variables are available except under app context, e.g. available inside New-UDApp.