Skip to content

fix(webchat): clear typing indicator when the bot reply arrives - #1149

Merged
realcodesiman merged 1 commit into
ChatbotXIO:mainfrom
grupoarcos:fix/webchat-clear-typing-on-reply
Sep 12, 2026
Merged

fix(webchat): clear typing indicator when the bot reply arrives#1149
realcodesiman merged 1 commit into
ChatbotXIO:mainfrom
grupoarcos:fix/webchat-clear-typing-on-reply

Conversation

@grupoarcos

@grupoarcos grupoarcos commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #1148

Problem

The worker's automated-response path posts { typing: true } while generating a reply (immediately and every 4 s) and never posts { typing: false }. The webchat widget only clears isTyping on a typing event, so after the first bot reply the typing dots stay on screen until the iframe is reloaded.

Change

In webchat-realtime.tsx, when a messageCreated event with messageType === "outgoing" arrives, call setIsTyping(false) after handleNewMessage. Incoming messages (echo of the guest's own message) do not touch the indicator.

Verification

Self-hosted install, images from 2026-09-08, AI agent as default reply. Confirmed in the realtime log that only typing: true and messageCreated are ever posted for the guest room.

Behavioral test on the live widget (headless Chromium, fresh guest per run, the served widget chunk intercepted and the same one-line change applied to the compiled code):

scenario bot reply dots when the reply renders dots 6 s later
unmodified widget 14.7 s 3 (stuck) 3
with this change 14.9 s 0 0

Not built from source in this environment; the change is the compiled equivalent of the diff. Happy to move the fix to the worker side (typing: false after clearInterval) if you prefer.

The worker sends typing:true while generating and never typing:false,
so the widget kept the typing dots on screen after every bot reply.
Clear isTyping when an outgoing messageCreated event is received.

Fixes ChatbotXIO#1148
@github-actions github-actions Bot added the bug Something isn't working as expected label Sep 11, 2026
@grupoarcos
grupoarcos marked this pull request as draft September 11, 2026 13:10
@grupoarcos
grupoarcos marked this pull request as ready for review September 11, 2026 13:12
@realcodesiman
realcodesiman merged commit 0124814 into ChatbotXIO:main Sep 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webchat: typing indicator never clears after the bot reply (no typing:false is ever sent)

2 participants