Repository navigation
Keep a Back pressed while a page starts on its entry - #3633
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3395
A Back pressed while the page before it was still starting could land on the wrong history entry. Two location-changing handlers were always registered: the shell's drawer handler, registered when the shell started (
AdminLayout.razor), and the form's unsaved-changes guard, registered inOnInitialized(ContentForm.razor). While any such handler is registered, Blazor'spopstatehandler inblazor.webassembly.jsdoes three things. It takes the Back back withhistory.go(+1), asks the .NET handlers, and then goes again withhistory.go(-1). Between those steps the current entry is the page being left, so a second Back pressed then moves from that entry. The test from #3394 hit exactly this.Fix:
NavigateAwaysets the pass for the form's own move only while the guard is registered.What it leaves: Blazor still takes a Back back and goes again in some cases, so a quick second Back can still land wrong there:
These go on the admin's follow-up list #3610.
Test:
HistoryTests.TwoBacksFromAnEntryThatIsStillStartingLandTwoEntriesBackopens two lists and then an entry, and holds the entry's read by a Playwright route, so the entry page is still starting. It presses Back, and presses Back again from the page'spopstatefor that first Back. It expects the list two entries back, and checks that Forward goes to the list after it. On the code before the fix it failed three runs of three, staying one entry short.Dependencies
None.
Acceptance
Verification
Run locally:
dotnet build -c Release -warnaserrorgave 0 warnings and 0 errors.FluentCMS.Admin.Tests: 2144 of 2144 passed.FLUENTCMS_E2E_SLOW=1and without it.FormBehaviourTests,ListTestsandFilterTestspassed, 8 of 8.eng/check-admin-size.cs, run once on a publish into an empty folder, gave 3,593,986 B of 3,600,000 B.Only CI shows the rest of the end-to-end suite, the other test projects and providers, and the size check of the first download on its own publish.