Trace: fetch/XHR response bodies hidden in the player on Safari (content.mimeType is empty)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
Empieza por la asignación de content.mimeType en packages/trace/src/trace-har.ts, cerca de la línea 138, que solo lee entry.response?.mimeType. Revisa cómo llegan los responseHeaders del collector de la página a esa entrada y luego añade un respaldo en el encabezado content-type, quitando cualquier parámetro. Está terminado cuando las entradas de fetch/XHR de una traza de Safari reciben un mimeType textual y sus cuerpos aparecen en la pestaña Network; un test que pase una entrada solo con responseHeaders por el converter lo confirmaría.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
In trace mode on iOS Safari (Appium XCUITest, no WebDriver BiDi), the Network tab of show-trace shows response headers for the page's fetch/XHR calls, but never the response body.
The body is in the trace. The resource-snapshot entries in trace.network carry response.content.text (or _sha1 with the file under resources/), and response.headers contains content-type: application/json. But response.content.mimeType is "":
"response": {
"status": 200,
"headers": [{ "name": "content-type", "value": "application/json" }, ...],
"content": { "size": 1297, "mimeType": "", "text": "{\"id\":...}", "_sha1": "..." }
}
The player only reads a body when the mime type is textual (/json|xml|javascript|ecmascript|^text\// in the trace parser, for both inline text and _sha1), so every body is dropped.
Cause
packages/trace/src/trace-har.ts:138
const mimeType = entry.response?.mimeType ?? ''
The requests the page collector records (the fetch/XHR patch that serves Safari and Appium sessions) carry responseHeaders but no response.mimeType. With no fallback, content.mimeType ends up empty.
Suggested fix
Fall back to the content-type header:
const headers = entry.response?.headers ?? entry.responseHeaders
const mimeType =
entry.response?.mimeType ||
String(headers?.['content-type'] ?? '').split(';')[0].trim()
We applied the same change as a local patch to the built dist/index.js. After it, all 21 fetch/XHR entries in our trace have mimeType: application/json, and their bodies are readable. Setting response.mimeType where the collector's requests are ingested would fix it at the source too.
Environment
@wdio/devtools-service11.2.0 (@wdio/devtools-app1.13.0), WebdriverIO 9.33.1- Appium 3.5, XCUITest driver 12.22.8, iOS 18.6 Simulator, Safari
- Service options:
{ mode: 'trace', traceFormat: 'zip', traceGranularity: 'spec' }
- Lenguaje dominante
- TypeScript
- Estrellas
- 10
- Forks
- 4
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de webdriverio/devtools
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
webdriverio/devtools#585 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 44/100
webdriverio/devtools#584 ·
Los mantenedores suelen responder en 1 día
-
Python: capture the native element tree per action in trace modePosiblemente ocupada @vishnuv688 la tomó hace 15 días. Abierto
webdriverio/devtools#570 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Trace query MCP server: let coding agents debug a failed run from its trace.zipPosiblemente ocupada @vishnuv688 la tomó hace 27 días. Abiertoenhancement
webdriverio/devtools#493 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de webdriverio/devtools
Issues similares
-
Postgres upgrade golden leaves fixture URL query parameters in the expected output comparisonAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
garrytan/gbrain#10437 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bedrock "Too many tokens" throttle is not auto-retried, unlike "Too many requests"Posiblemente ocupada @acmerfight la tomó hoy. Abiertountriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
earendil-works/pi#12573 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
agentes-chat/agentes-chat#1506 ·
Los mantenedores suelen responder en 1 día
-
comp/desktop desktop/files os/windows P2 type/perf
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
NousResearch/hermes-agent#160359 ·
Los mantenedores suelen responder en 1 día
-
Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
software-mansion/react-native-reanimated#11554 · 1 comentario ·
Los mantenedores suelen responder en 1 día