Skip to content

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

Merged
sy-records merged 3 commits into
docsifyjs:developfrom
xu91102:fix/cached-response-status
Oct 27, 2026
Merged

sy-records merged 3 commits 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
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docsify-preview Ready Ready Preview Oct 27, 2026 3:00am UTC

@sy-records sy-records 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.

Thanks

@sy-records
sy-records merged commit 91c923a into docsifyjs:develop Oct 27, 2026
8 checks passed
@sy-records sy-records mentioned this pull request Oct 28, 2026

This branch was successfully deployed

1 active deployment
Preview — 6a3c4471 Deployed Oct 27, 2026 by vercel[bot]
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

3 participants