fix: MCD-1270 Keep redirect payloads in the page cache so SPA repeat visits follow CE-API redirects.#509
Open
drubot wants to merge 1 commit into
Open
fix: MCD-1270 Keep redirect payloads in the page cache so SPA repeat visits follow CE-API redirects.#509drubot wants to merge 1 commit into
drubot wants to merge 1 commit into
Conversation
…visits follow CE-API redirects.
jeremychinquistdrunomicscom
approved these changes
Jul 27, 2026
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.
Summary
CE-API redirects were not followed on repeat SPA visits to a redirected path: the URL stayed on the source path and the previously mounted page remained visible (MOP-571, observed on beta.vegan.at
/newsletter→/inhalt/newsletter-anmeldung).Root cause
Not a navigation race (the imperative
navigateTo()infetchPage()wins fine, first visits always work): after handling a redirect,fetchPage()didpageRef.value = createEmptyPage().pageRefis theuseFetchdata ref bound to the payload cache entry of the redirect source path, so this overwrote the cached redirect payload with an empty page. On every subsequent SPA visit to the path,fetchPage()served the poisoned cache entry — noredirectkey, no navigation, empty page under the source URL, previous page effectively still visible.Reproduced live on beta.vegan.at: first SPA visit to
/newsletterfollows the redirect, second visit strands on/newsletterwith the Startseite title. Reproduced the same in the playground e2e (red without this fix, green with it).Fix
Return a detached
ref(createEmptyPage())from the redirect branch instead of writing the empty page through into the payload cache. The cache retains the redirect payload, so repeat visits re-run the redirect handling. SSR (real 301) and external redirects unchanged.Tests
test/e2e/redirect.test.ts: SPA navigation to a redirecting path, twice (the repeat visit is the regression case). Verified red on unfixed2.x, green with the fix./redirect-to-3CE-API route + main-menu entry to click.npm test: 124 passed (one unrelated suite flaked on a busy port, passes in isolation). Pre-existing lint errors on2.xuntouched.Refs: MCD-1270
Drafted with Claude Code from claude-vm-3.