[next-chat] Typing indicator gets stuck when a socket disconnects mid-typing
Maintainer thường phản hồi trong vòng 1 ngày
@officialasishkumar đang làm issue này rồi.
Từ ngày 3/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 5.2k
- Fork
- 1.9k
- Merge trung bình
- 1 giờ 4 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel/examples
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CARGO-TAXIĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Better ChoicezĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
vercel/examples#1584 · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
onbeat landing pageĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel/examples
Issue tương tự
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/DebateAI#801 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: repo has no GitHub Actions workflow, so pushes and pull requests are never built or testedĐang mở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
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Add: BOM CineĐang mởapproved check:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày