Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#2,812 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 8 días

@xu91102 ya está trabajando en esto.

Desde el 26/9/2026.

  • #2813 de @xu91102 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
web-dev

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
31.5k
Forks
5.8k
Merge medio
7 d 18 h
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de docsifyjs/docsify

Todos los issues de docsifyjs/docsify

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.