fix: eliminate send-to-screen delay by adding user message to items immediately#3430
Merged
Merged
Conversation
…mmediately
Previously, dispatch({type:"user"}) only set pendingUser, leaving the
actual items[] append to flushPendingUser — which waited for a backend
event after turn_started. The Go backend init + Wails bridge round trip
caused a multi-second delay before the user saw their own message.
Now the reducer appends to items[] directly while keeping pendingUser
set, so cancel() still works. flushPendingUser detects the message is
already rendered and only clears the flag.
Fixes esengine#3296.
12c6897 to
a69dfb0
Compare
added 2 commits
June 7, 2026 16:28
Same root cause as PR esengine#3418 — the .onboarding__skip:disabled block was missing its closing '}', causing check-css-syntax.mjs to fail.
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.
Problem
After clicking Send / pressing Enter, the user's own message takes multiple seconds (sometimes 10-60s) to appear on screen. Every single message is affected regardless of network speed.
Fixes #3296.
Root cause
dispatch({type:"user"})only setpendingUser, leaving the actualitems[]append toflushPendingUser— which waited for a backend event afterturn_started. The Go backend initialization + Wails bridge round trip caused the delay.Fix
The reducer now appends to
items[]directly (so the message renders instantly) while keepingpendingUserset (socancel()still works).flushPendingUserdetects the message is already rendered and only clears the flag.Testing
cd desktop/frontend && pnpm build— ✅gofmt -l .— ✅ clean