Skip to content

Preserve PathBase in SPA back/forward flows by using server canonical URL for initial request state#2027

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-back-navigation-pathbase-issue
Draft

Preserve PathBase in SPA back/forward flows by using server canonical URL for initial request state#2027
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-back-navigation-pathbase-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

From 4.3.9 onward, SPA back navigation could leave client request state pointing to a PathBase-stripped URL, causing subsequent SPA-triggered requests/navigation to target wrong paths (e.g. /spa-page2 instead of /subpath/spa-page2).
This change keeps SPA request state aligned with the server-canonical route URL returned by navigation responses.

  • SPA URL state handling

    • Update SPA navigation state refresh to prefer response.result.url (server canonical URL) over the client-normalized URL.
    • This keeps getInitialUrl() PathBase-aware after SPA navigation/back-forward restoration.
  • Regression coverage

    • Add a focused script-level test that simulates SPA navigation with a server response URL containing a base path and asserts that getInitialUrl() is updated to that server URL.
  • Behavioral impact

    • Subsequent postbacks/static commands continue using the correct PathBase-prefixed endpoint after browser back/forward in SPA scenarios.
// before
updateInitialUrl(url);

// after
updateInitialUrl(response.result.url ?? url);

Copilot AI changed the title [WIP] Fix back navigation corrupts PathBase usage from version 4.3.9 Preserve PathBase in SPA back/forward flows by using server canonical URL for initial request state May 15, 2026
Copilot AI requested a review from tomasherceg May 15, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Back Navigation Corrupts PathBase Usage From Version 4.3.9 on

2 participants