-
Notifications
You must be signed in to change notification settings - Fork 1
fix(): reset finished when send message again #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a state management issue where the finished flag was not being properly reset when sending a new message in an ongoing conversation. The fix introduces a new started action to explicitly reset the finished state to false at the beginning of each request, and moves the finished action dispatch to the finally block to ensure it executes regardless of success or error outcomes.
Key Changes:
- Added a new
ConversationStartedActionto handle request initiation - Dispatch
startedaction at the beginning of each request to reset thefinishedflag - Moved
finishedaction dispatch from the try block to the finally block for guaranteed execution
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bricks/ai-portal/src/cruise-canvas/useConversationDetail.ts |
Added started action dispatch at request start and moved finished action to finally block for proper state management |
bricks/ai-portal/src/cruise-canvas/reducers/interfaces.ts |
Defined new ConversationStartedAction type for state reset |
bricks/ai-portal/src/cruise-canvas/reducers/conversation.ts |
Implemented started action handler to reset finished flag to false when a new request begins |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case "started": | ||
| if (state) { | ||
| return { ...state, finished: false }; | ||
| } | ||
| return state; |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new started action and the logic for resetting the finished flag lack test coverage. Since the tasks reducer has test coverage (tasks.spec.ts), similar test coverage should be added for the conversation reducer to verify:
- The
startedaction correctly setsfinished: falsewhen state exists - The
startedaction returns the existing state when state is null - The interaction between
startedandfinishedactions works correctly
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #484 +/- ##
==========================================
- Coverage 76.72% 76.70% -0.02%
==========================================
Files 594 594
Lines 18299 18302 +3
Branches 2818 2819 +1
==========================================
Hits 14039 14039
- Misses 3724 3727 +3
Partials 536 536
🚀 New features to boost your workflow:
|
|
📐🤏 Size check result (faa75ba...166be53): Load all bricks together
Critical changes: None. See full changes
Load bricks by each packageCritical changes: None. See full changes
Load by each brickCritical changes:
See full changes
Critical details for brick eo-auto-complete
Critical details for brick eo-directory-tree
Critical details for brick eo-input
Critical details for brick eo-markdown-editor
Critical details for brick eo-search
Critical details for brick eo-time-range-picker
Critical details for brick form.general-checkbox
Critical details for brick form.general-radio
|
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat作为提交类型。BREAKING CHANGE: 你的变更说明。新特性:
feat作为提交类型。问题修复:
fix作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore,docs,test等作为提交类型。