note the console log showing the sequence of events: SAVE -> PARAMS -> LOCATION;
reload the page;
note the sequence: INIT -> PARAMS;
clear the console again;
now edit the input box with some international text like Тест (this one is in Russian language, so just copy-paste) and press enter;
not the change in sequence: SAVE -> PARAMS -> LOCATION (2) (called two times);
reload the page;
note the sequence: INIT -> PARAMS -> LOCATION;
The issue is 10 and 12.
In 10 there should be only one location change just like in 5.
And in 12 there should be no location change at all, just like in 7.
Double location changes lead to multiple records in browser history so when a user presses back he is not navigated actually back in history because history is doubled and sometimes tripled.
Here is a repro. To reproduce:
Test
in the input box and press enter;SAVE
->PARAMS
->LOCATION
;INIT
->PARAMS
;Тест
(this one is in Russian language, so just copy-paste) and press enter;SAVE
->PARAMS
->LOCATION (2)
(called two times);INIT
->PARAMS
->LOCATION
;The issue is
10
and12
. In10
there should be only one location change just like in5
. And in12
there should be no location change at all, just like in7
.Double location changes lead to multiple records in browser history so when a user presses
back
he is not navigated actually back in history because history is doubled and sometimes tripled.My guess is that the issue is this: https://github.com/mrpmorris/Fluxor/blob/97997c704a69c346f692c06b475b0be472c03c61/Source/Fluxor.Blazor.Web/Middlewares/Routing/Effects.cs#L20
The
Uri
might be unescaping the URL it contains whereasNavigationManager.Uri
returns it as escaped sequence. Hence the difference.Perhaps something like this would be better?
In this case any irrelevant differences won't trigger location changing.