[next-chat] Typing indicator gets stuck when a socket disconnects mid-typing
メンテナーはふだん 1 日以内に返信
@officialasishkumar がすでに取り組んでいます。
2026年11月3日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
Start with ChatHub.handleClose in lib/chat/index.ts, which currently ignores typing state, and the typingUsers handling in lib/chatReducer.ts. Reproduce by mounting ChatHub on a plain ws server: one client sends { type: 'typing' } and is terminated, and the other should receive a stop typing frame. Done when a closing typist's peers get a stop typing for that user, and a rejoining client drops typing entries it can no longer trust.
索引モデルが issue の本文から書いたものです。
説明
Summary
In websockets/next-chat, the "X is typing" indicator can get stuck on other users' screens indefinitely.
There are two paths:
- Typist disconnects mid-typing. The client sends
typingon the first keystroke and relies on a 900 ms idle timer to sendstop typing. If the socket drops before that timer fires (closed tab, network blip, laptop sleep),send()is a no-op on the dead socket, sostop typingis never delivered.ChatHub.handleClose(lib/chat/index.ts) does nothing about typing state, so every peer keeps showing "alice is typing".- If the user reconnects within the presence staleness window (
PRESENCE_STALE_MS, 20 s by default), nouser leftframe is broadcast either. That frame is the only other thing that clearstypingUsersinlib/chatReducer.ts, so the indicator never clears.
- If the user reconnects within the presence staleness window (
- Viewer disconnects while someone stops typing. If a viewer's own socket is down when a peer's
stop typingis broadcast, the viewer misses it. After reconnecting, the viewer still shows the stale typing entry, because theloginframe sent on rejoin leavestypingUsersunchanged.
Steps to reproduce
- Open the chat in two tabs and join as
aliceandbob. - In alice's tab, start typing, then within ~1 s kill alice's connection (close the tab, or go offline in DevTools and back online).
- bob's tab keeps showing "alice is typing". If alice reconnects quickly, it never clears.
I also reproduced this outside the browser by mounting ChatHub on a plain ws server. Two clients join, one sends { type: 'typing' } and is then terminated, and the other client never receives a stop typing frame.
Expected
When a typing socket closes, peers should get a stop typing for that user. A client that rejoins after a disconnect should drop typing state it can no longer trust.
- 主要言語
- TypeScript
- スター
- 5.2k
- フォーク
- 1.9k
- 平均マージ
- 1時間 4分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel/examples のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
CARGO-TAXIオープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
メンテナーはふだん 1 日以内に返信
-
Better Choicezオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
vercel/examples#1584 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
onbeat landing pageオープン
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
vercel/examples の issue をすべて見る
似ている issue
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/DebateAI#801 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Add: BOM Cineオープンapproved check:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信