[next-chat] Typing indicator gets stuck when a socket disconnects mid-typing
Los mantenedores suelen responder en 1 día
@officialasishkumar ya está trabajando en esto.
Desde el 3/11/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 5.2k
- Forks
- 1.9k
- Merge medio
- 1 h 4 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel/examples
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
CARGO-TAXIAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
Los mantenedores suelen responder en 1 día
-
Better ChoicezAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
vercel/examples#1584 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
onbeat landing pageAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de vercel/examples
Issues similares
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/DebateAI#801 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
ci: repo has no GitHub Actions workflow, so pushes and pull requests are never built or testedAbiertoagents 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
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Add: BOM CineAbiertoapproved check:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día