fix(app-shell): stop double-toasting failed script/modal action errors#2177
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
serverActionHandler toasted the action error itself AND returned
{ success:false, error }, which ActionRunner.handlePostExecution ALSO
toasts — so a failed script action (e.g. a validation throw) showed two
identical red toasts. apiHandler and flowHandler already only return the
error and let the runner toast it; align serverActionHandler with them.
This was referenced Jul 5, 2026
This was referenced Jul 5, 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.
问题
某项目动作
lead_apply_convert校验失败时,同一条错误 toast 弹出两遍(两个完全相同的红色 toast 叠着)。根因
useConsoleActionRuntime里的serverActionHandler(type: 'script'/modal动作)对失败弹了一次toast.error(...),同时又return { success: false, error };而ActionRunner.handlePostExecution会再把error弹成一次 toast → 双弹。对照:同文件的
apiHandler/flowHandler都只return { success:false, error }、由 runner 统一弹,所以它们只弹一次。唯独serverActionHandler多弹了。改动
删掉
serverActionHandler里两处多余的toast.error(...)(失败响应分支 + catch 分支),与apiHandler/flowHandler对齐 —— 错误 toast 统一交给ActionRunner.handlePostExecution,失败动作只弹一次。toastimport 仍被其他地方使用(弹窗拦截提示、toastHandler),无未用 import。测试
useConsoleActionRuntime.test.tsx全绿(19/19),新增回归用例:失败的 script 动作返回{success:false, error}但不自行toast.error。@object-ui/app-shelltsc --noEmit0 error。