Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#2,812 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@xu91102 arbeitet bereits daran.

Seit 26.9.2026.

  • #2813 von @xu91102 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript
Bereich
web-dev

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
JavaScript
Sterne
31.5k
Forks
5.8k
Ø Merge
2 T. 14 Std.
Gemergte PRs (30 T.)
5

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus docsifyjs/docsify

Alle Issues in docsifyjs/docsify

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.