Cached AJAX responses lose status metadata exposed through vm.route.response
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- web-dev
Hướng nghiên cứu
Start at Fetch's contentFetched handler and trace the cache-hit path that invokes the success callback. Reproduce the case with the existing xhr-mock dependency in the Jest/JSDOM setup, then verify that a cached request passes the original content, options, and response metadata consistently with the first request.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Current behavior
The first AJAX request calls the success callback with (content, options, responseStatus), but a cache hit calls it with only (content, options). Fetch's contentFetched handler assigns that third argument to vm.route.response, so revisiting a cached page loses the response status available on the first visit.
On develop f34374b7423340e5ddec81c8ff565c26cc056fb5, a regression using the existing xhr-mock dependency shows:
get('/page.md').then((content, options, response) => {
// First request: response is { ok: true, status: 200, statusText: 'OK' }
get('/page.md').then((cachedContent, cachedOptions, cachedResponse) => {
// cachedResponse is undefined
});
});
Expected behavior
Cached content should carry the original response metadata too. Plugins should be able to inspect vm.route.response consistently across initial loads and revisits without adding cache-specific workarounds.
Suggested fix
Store the response status alongside the cached content and options, and pass all three to the callback on cache hits. This preserves the actual response status rather than synthesizing a 200 response.
Environment
Docsify 5.0.0 develop source, Jest/JSDOM on macOS. Reproduced with an HTTP response mock at the XMLHttpRequest boundary.
- Ngôn ngữ chính
- JavaScript
- Star
- 31.5k
- Fork
- 5.8k
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docsifyjs/docsify
-
Query parameter values are truncated at a second equals signCó thể đã có người làm @xu91102 đã nhận 22 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Bullet points beginning with inline math: subsequent text formatting not recognised correctlyĐang mởbug Triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
In the Edge browser, the character `{docsify-updated}` is not replacedCó thể làm lại được @AmanUllah687 đã nhận 75 ngày trước và không có pull request nào đang mở. Đang mởwait for information
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
docsifyjs/docsify#2681 · 11 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Nested/Recursive includesĐang mởfeature request Triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
docsifyjs/docsify#2643 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Is it possible not to push unnecessary state when clicking an <a> element?Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởneeds discussion
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của docsifyjs/docsify
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
HarperFast/harper#3275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug release:v5.34
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Jason-Vaughan/TangleClaw#2504 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mastra-ai/mastra#27538 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Foundryborne/daggerheart#2497 ·
Maintainer thường phản hồi trong vòng 1 ngày