Repository navigation
fix(dashboard): drop the stale expert welcome while the next one loads - #1848
Open
JasonBuildAI wants to merge 1 commit into
Open
JasonBuildAI wants to merge 1 commit into
JasonBuildAI wants to merge 1 commit into
Conversation
Switching experts left the previous expert's welcome message and quick-prompt cards on screen — still clickable — until the new /chat/welcome response arrived; switching the UI language did the same. useExpertChatWelcome cancelled late responses but never cleared the state it had already loaded, so Chat/index.tsx kept handing the stale values to WelcomeScreen. Clear fetchedCards and welcomeSuffix before the request starts. Refs TencentCloud#1480
JasonBuildAI
force-pushed
the
fix/dashboard-stale-expert-welcome
branch
from
October 15, 2026 17:40
6f08615 to
ee31acb
Compare
This branch has not been deployed
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.
Summary
Switching experts in Chat left the previous expert's welcome message and quick-prompt cards on screen — still clickable — until the new expert's
/api/agents/{agent_id}/chat/welcomeresponse arrived. Switching the UI language had the same effect.useExpertChatWelcome()cancelled late responses, but it never cleared the state it had already loaded when a new request started, soChat/index.tsxkept passing the stale values intoWelcomeScreenfor the newly selected expert.The fix clears
fetchedCards/welcomeSuffiximmediately before starting the request, so the pending state is empty instead of the previous expert's content. The existing cancellation guard is unchanged: a late response from the expert that was switched away from is still ignored.Fixes #1480
Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
Added
dashboard/src/pages/Chat/hooks/useExpertQuickCards.test.ts— 4 cases: expert switch, language switch, late response ignored, no expert selected.Before the fix — 2 failed, 2 passed:
After the fix — 4 passed:
Other checks (Windows 11, Python 3.12, Node 22):
makeis not installed in this shell, so the four gate commands were run individually instead ofmake all.Full dashboard suite (
npx vitest run): 10 failed | 1206 passed. All timeouts in unrelated files. Re-running those test files on a pristinedevelopcheckout gives the identical 7 files / 4 tests failing (and the remaining 4 passing), so this change adds no new failures.Backend suite (
uv run pytest -n auto -m "not live"): 53 failed | 4322 passed | 158 skipped. The same 53 fail on a pristinedevelopcheckout (verified with a serial--lfre-run on both trees), so they are pre-existing on this Windows machine.npm run format:checkflags 1105 files on this checkout becausecore.autocrlf=truechecks everything out as CRLF; Prettier passes on the two files touched here.npm run lintreports 3 pre-existing errors in other files; none of them in the files touched here.make allpasses locally (individual ruff / mypy / pytest commands; see above)Added/updated tests
Checklist
CHANGELOG.md(if user-facing)AI disclosure: this change was drafted with AI assistance at my request, under my direction and review.