Test the live updates stream (/api/events)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Read the /api/events route in server/server.js and the existing tests and Client class in tests/api.test.mjs. Add coverage for unauthenticated access, the initial change event and revision, updates after a write, and the proposals event. Run npm test; cancel the stream reader so the test process exits.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The task
When someone changes the map, the others see it live: the browser keeps GET /api/events open, a Server-Sent Events stream, and the server pushes an event on every change. Nothing tests this stream. Add a test, so that a change to the server cannot silently stop live updates.
Where to look
server/server.js: the/api/eventsroute (around line 359) sendsevent: changewith the currentrevas soon as it opens;commitChanges()then broadcastschangewith the newrevafter every write, andsaveProposals()broadcastsproposalstests/api.test.mjs: the existing tests and theClientclass.fetchcan read a stream: readres.bodywith a reader and split the text on blank lines (\n\n), each block is one event
Close the stream at the end of the test (cancel the reader), or the test run will not exit.
Done when
- Opening
/api/eventswithout credentials gets401 - With credentials, the first event is
changewith the currentrev - After a write (
PUT /api/si/...as an approver), achangeevent arrives withrev + 1 - Creating a proposal sends a
proposalsevent -
npm testpasses, and exits on its own
Mentor
@0b3l1X-SolidGeeks
- Lenguaje dominante
- JavaScript
- Estrellas
- 0
- Forks
- 1
- Merge medio
- 14 min
- PR fusionados (30 d)
- 31
Preparar el entorno
- Incluye un Dockerfile o un 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 SolidGeeks/strata
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SolidGeeks/strata#21 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
SolidGeeks/strata#22 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
SolidGeeks/strata#20 ·
Los mantenedores suelen responder en 1 día
Todos los issues de SolidGeeks/strata
Issues similares
-
[version] Windows WMPF 26042 偏移Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
evi0s/WMPFDebugger#303 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
HakanSeven12/OpenCADStudio#2257 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[bug] extension mappingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
bug code-annotation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quarto-dev/quarto-cli#15215 ·
Los mantenedores suelen responder en 1 día