ironmansoftware / issues

Public Issue tracker for Ironman Software products.
https://ironmansoftware.com
31 stars 2 forks source link

Query URL Param Session not refreshing when using Invoke-UDRedirect #3424

Closed jhadvan closed 1 week ago

jhadvan commented 1 week ago

Version

4.3.0

Severity

High

Environment

IIS

Steps to Reproduce

When I am using Invoke-UDRedirect -Url "/Status?q=12345" when going to Status page and using $Query.q to get the query parameters q it is returning null, but when I refresh the page the query parameter q is now declared.

When using UDRedirect /Status?q=12345 the value will be returned as NULL then refreshed q will now become 12345 then any future value will be returned as 12345

The query param works on some page, but on some page it doesn't

Example Code

New-UDTypography -Text 'Home' -Id 'homeText'
New-UDButton -Text 'click me 123' -OnClick {
    Invoke-UDRedirect -Url "/parmPage?q=123"
}

New-UDButton -Text 'click me 321' -OnClick {
    Invoke-UDRedirect -Url "/parmPage?q=321"
}

Expected behavior

I am expecting $Query.q to store the parameter of 12345

Actual behavior

$Query.Q is returning cache value of whatever is previously stored.

Additional Environment data

No response

Screenshots/Animations

No response

jhadvan commented 1 week ago

So I fixed this by removing the / when calling New-UDRedirect.

Bad Code

New-UDTypography -Text 'Home' -Id 'homeText' New-UDButton -Text 'click me 123' -OnClick { Invoke-UDRedirect -Url "/parmPage?q=123" }

New-UDButton -Text 'click me 321' -OnClick { Invoke-UDRedirect -Url "/parmPage?q=321" }

Fixed Code

New-UDTypography -Text 'Home' -Id 'homeText' New-UDButton -Text 'click me 123' -OnClick { Invoke-UDRedirect -Url "parmPage?q=123" }

New-UDButton -Text 'click me 321' -OnClick { Invoke-UDRedirect -Url "parmPage?q=321" }

adamdriscoll commented 1 week ago

I can't reproduce this with either code. Here's the full app code I'm trying.

New-UDApp -Pages @(
    New-UDPage -Name Home -Content {
 New-UDTypography -Text 'Home' -Id 'homeText'
New-UDButton -Text 'click me 123' -OnClick {
    Invoke-UDRedirect -Url "/parmPage?q=123"
}

    }
    New-UDPage -Name parmPage -Content {
        New-UDButton -Text 'click me 321' -OnClick {
    Invoke-UDRedirect -Url "/parmPage?q=321"
}
        Show-UDToast $Query['q']
    }
)
MikeShepard commented 1 week ago

I have tested in msi (:5000) in 5.0 beta 7 and it works. Nested IIS in 4.3 does not

adamdriscoll commented 1 week ago

Works for me in nested IIS. I am running the 4.3.1 nightly but no changes were made to this in this version.

image

image

adamdriscoll commented 1 week ago

Oh, I'm dumb. That's because this was fixed in 4.3.1 and not 4.3.0.