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

Test the live updates stream (/api/events)

Cerrado
#8 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Área
backend, testing

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

good first issue help wanted
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/events route (around line 359) sends event: change with the current rev as soon as it opens; commitChanges() then broadcasts change with the new rev after every write, and saveProposals() broadcasts proposals
  • tests/api.test.mjs: the existing tests and the Client class. fetch can read a stream: read res.body with 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/events without credentials gets 401
  • With credentials, the first event is change with the current rev
  • After a write (PUT /api/si/... as an approver), a change event arrives with rev + 1
  • Creating a proposal sends a proposals event
  • npm test passes, 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

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 SolidGeeks/strata

Todos los issues de SolidGeeks/strata

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.