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

The bug in InMemoryEventStore break SSE stream resumability

Abierto Apto para principiantes
#943 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Genmin ya está trabajando en esto.

Desde el 29/4/2026.

  • #1978 de @Genmin — abierto
  • #1984 de @Genmin — abierto

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
Tranquilo
Stack tecnológico
typescript
Área
api, backend

Línea de trabajo

Comienza en src/examples/shared/inMemoryEventStore.ts y compara generateEventId, getStreamIdFromEventId y replayEventsAfter con el manejo del stream en src/server/streamableHttp.ts. Reproduce el escenario de reconexión con dos elicitaciones y, después, verifica que Last-Event-ID se analice de forma coherente y que los eventos emitidos anteriormente se devuelvan cuando se reanude el stream SSE.

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

Descripción

bug fix proposed P2 ready for work

Describe the bug
The standalong sse stream Id is coded to _GET_stream and the current InMemoryEventStore generate event Ids in the format -
${streamId}-${Date.now()}_${Math.random().toString(36).substring(2, 10)}

The replayEventsAfter(...) is called when client try to re-connect and resume the stream which further calls getStreamIdFromEventId(...) -

    // Extract the stream ID from the event ID
    const streamId = this.getStreamIdFromEventId(lastEventId);
    if (!streamId) {
      return '';
    }

The issue is that getStreamIdFromEventId(...) will always return an empty string as the streamId due to the current eventId format and the code will return from this if check.

To Reproduce
Steps to reproduce the behavior:

  1. Create a tool with at least 2 elicitation requests.
  2. Call the tool.
  3. Try to reconnect with SSE stream - nothing will be returned.

Expected behavior
MCP client should be able to re-connect to SSE stream.

Fix
The fix could be to use a different delimiter than underscore when combining streamId with rest of the eventId.
Used dash("-") in below sample fix -

  /**
   * Generates a unique event ID for a given stream ID
   */
  private generateEventId(streamId: string): string {
--->    return `${streamId}**-**${Date.now()}_${Math.random().toString(36).substring(2, 10)}`;
  }

  /**
   * Extracts the stream ID from an event ID
   */
  private getStreamIdFromEventId(eventId: string): string {
--->    const parts = eventId.split('**-**');
    return parts.length > 0 ? parts[0] : '';
  }
Lenguaje dominante
TypeScript
Estrellas
13.5k
Forks
2.3k
Merge medio
1 d 22 h
PR fusionados (30 d)
52

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 modelcontextprotocol/typescript-sdk

Todos los issues de modelcontextprotocol/typescript-sdk

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.