Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The bug in InMemoryEventStore break SSE stream resumability

オープン 初心者向け
#943 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Genmin がすでに取り組んでいます。

2026年4月29日 から。

  • #1978 @Genmin による — オープン
  • #1984 @Genmin による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript
領域
api, backend

調査の方向性

src/examples/shared/inMemoryEventStore.ts から始め、generateEventId、getStreamIdFromEventId、replayEventsAfter と、src/server/streamableHttp.ts でのストリーム処理を比較します。2 つの elicitation を行う再接続シナリオを再現し、その後、Last-Event-ID が一貫して解析され、SSE ストリームが再開されたときに以前に発行されたイベントが返されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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] : '';
  }
主要言語
TypeScript
スター
13.5k
フォーク
2.3k
平均マージ
2日 18時間
マージ済み PR(30日)
55

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/typescript-sdk のほかの issue

modelcontextprotocol/typescript-sdk の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。