[Bug]: bidi reports transfer size as responseBodySize, so request().sizes() over-reports the body by the header size
Los mantenedores suelen responder en 1 día
@dcrousso ya está trabajando en esto.
Desde el 21/9/2026.
- #42700 de @ashrafiucse — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- networking
Línea de trabajo
Empieza en packages/playwright-core/src/server/bidi/bidiNetworkManager.ts:168 y compara después la relación de fallback en network.ts:719 y el manejo de CDP descrito en la issue. Comprueba si BiDi Network.ResponseData proporciona headersSize junto con bodySize. Se considera terminado cuando request().sizes() informa del cuerpo de 2000 bytes por separado de los headers de la respuesta para la reproducción y otras formas de respuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
1.64.0-next, d1ead3ecc. Chrome 141 over --project=bidi-chrome-page.
Steps to reproduce
Serve a body of a known length and read sizes():
server.setRoute('/fixed', (req, res) => {
const plain = 'x'.repeat(2000);
res.writeHead(200, { 'content-type': 'text/plain', 'content-length': String(plain.length) });
res.end(plain);
});
const resp = await page.goto(server.PREFIX + '/fixed');
console.log(await resp.request().sizes());
Expected
responseBodySize of 2000, as chromium over CDP reports:
chromium (CDP) {"requestBodySize":0,"requestHeadersSize":674,"responseBodySize":2000,"responseHeadersSize":151}
Actual
bidi-chrome {"requestBodySize":0,"requestHeadersSize":343,"responseBodySize":2151,"responseHeadersSize":132}
2151 for a 2000 byte body. That number is exactly CDP's body plus CDP's header size (2000 + 151), so what is coming back is the whole transfer, headers included, in the body field. Same overshoot on the other shapes I tried: a gzipped body whose encoded length is 35 reports 208, and a chunked response whose wire body is 15 reports 172.
Cause
packages/playwright-core/src/server/bidi/bidiNetworkManager.ts:168:
response.setTransferSize(params.response.bodySize);
response.setEncodedBodySize(params.response.bodySize);
One protocol field feeds two different metrics. The codebase treats them as distinct, and network.ts:719 spells the relationship out in the fallback path:
transferSize = responseHeadersSize + encodedBodySize;
so setting both from one value cannot be right for both. CDP keeps them apart:
response.setTransferSize(event.encodedDataLength);
response.responseHeadersSize().then(size => response.setEncodedBodySize(event.encodedDataLength - size));
WebKit only sets setEncodedBodySize(event.metrics?.responseBodyBytesReceived) and leaves transfer size to the fallback.
If BiDi's network.ResponseData carries headersSize alongside bodySize, subtracting it the way CDP does would line the two up. I did not check what Chrome actually populates there, so that part is a suggestion rather than a diagnosis.
Scope
Only the bidi backend, which I realise is still experimental and tracked under #32577, so this is a low-priority one. Filing it discretely because the value is plainly wrong rather than merely missing, and the cause is two lines.
I am a freshman in college doing my best to contribute usefully, so if bidi gaps are better collected on #32577 than filed one by one, tell me and I will move it there.
- Lenguaje dominante
- TypeScript
- Estrellas
- 100k
- Forks
- 6.9k
- Merge medio
- 16 h 8 min
- PR fusionados (30 d)
- 281
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/playwright#44289 ·
Los mantenedores suelen responder en 1 día
-
agent-triage-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/playwright#44264 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] WebKit keeps every removed iframe's JS heap alive (memory grows until the page crashes)Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
microsoft/playwright#44290 ·
Los mantenedores suelen responder en 1 día
-
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
microsoft/playwright#44288 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
microsoft/playwright#44287 ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/playwright
Issues similares
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
openclaw/openclaw#203385 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nwverse/persona#12800 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 Medio día Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
WISE-Community/WISE-Client#2404 ·
Los mantenedores suelen responder en 1 día