Skip to content

fix(ajax): retain response status in cached results - #2813

Open
xu91102 wants to merge 1 commit into
docsifyjs:developfrom
xu91102:fix/cached-response-status
Open

xu91102 wants to merge 1 commit into
docsifyjs:developfrom
xu91102:fix/cached-response-status

Conversation

@xu91102

@xu91102 xu91102 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Cache the original response status together with content and options, and pass it to callbacks on cache hits. Previously, revisiting a cached page set vm.route.response to undefined, even though the first visit provided { ok, status, statusText }.

Fixes #2812.

Added a regression through the public AJAX helper, mocking only XMLHttpRequest. It compares the complete callback payload for the initial request and the cached request.

Validation:

  • Regression failed before the fix because the cached response was undefined, then passed.
  • npm run test:jest -- --runInBand: 14 suites, 125 tests, 46 snapshots passed.
  • npm run typecheck and npm run build: passed.
  • Prettier/ESLint checks for changed files and git diff --check: passed.

Assisted by Codex; reviewed the full diff and ran these checks locally. The full Playwright browser matrix was not run locally.

@vercel

vercel Bot commented Sep 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Docsify Team on Vercel.

A member of the Team first needs to authorize it.

@Koooooo-7 Koooooo-7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Koooooo-7
Koooooo-7 requested a review from a team September 27, 2026 01:52

This branch has not been deployed

No deployments
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.

Cached AJAX responses lose status metadata exposed through vm.route.response

2 participants