fix(webchat): clear typing indicator when the bot reply arrives - #1149
Merged
realcodesiman merged 1 commit intoSep 12, 2026
Merged
Conversation
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
grupoarcos
marked this pull request as draft
September 11, 2026 13:10
grupoarcos
marked this pull request as ready for review
September 11, 2026 13:12
realcodesiman
approved these changes
Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clearsisTypingon atypingevent, so after the first bot reply the typing dots stay on screen until the iframe is reloaded.Change
In
webchat-realtime.tsx, when amessageCreatedevent withmessageType === "outgoing"arrives, callsetIsTyping(false)afterhandleNewMessage. 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: trueandmessageCreatedare 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):
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: falseafterclearInterval) if you prefer.