Skip to content

Codex/frontend code review fixes#285

Open
ClozyA wants to merge 2 commits into
dev_v2from
codex/frontend-code-review-fixes
Open

Codex/frontend code review fixes#285
ClozyA wants to merge 2 commits into
dev_v2from
codex/frontend-code-review-fixes

Conversation

@ClozyA

@ClozyA ClozyA commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

在前端范围内收紧 Electron API 的类型定义和使用方式,用带类型的辅助方法替代不安全的 any 类型转换和直接的 fetch 调用,并改进面向用户的存储清理和日志导出流程。

New Features:

  • 暴露带类型的 appRestart Electron API,以便在前端进行受控的应用重启。
  • 引入带类型的 LogExportResult 契约用于日志导出操作,并将其传播到所有使用方。

Bug Fixes:

  • 确保日志导出的使用方能够处理来自主进程的完整结构化结果,包括消息内容和压缩包路径。
  • 通过使用带类型的应用重启 API 改善后端重启行为,并在 Electron 能力不可用时保持回退逻辑的一致性。

Enhancements:

  • 在开发者工具的存储清理中,用 Ant Design Vue 的模态框和 toast 消息替代浏览器原生的 confirm/alert。
  • 对文件选择和日志记录的 Electron 预加载脚本与类型声明进行统一,使用共享的 Electron FileFilter 类型和 unknown 日志参数类型,而非 any
  • 通过 useScriptApi 组合式函数来路由脚本配置导入,以集中业务逻辑并保持 Vue 页面精简。
  • 规范前端对 window.electronAPI 的使用,在初始化、后端控制、设置、历史记录和编辑器视图中依赖带类型的 API,而不是在这些场景下使用 any 断言。

Tests:

  • 添加 Vitest 测试套件,用于断言 Electron API 的类型契约、日志导出结果结构、脚本配置导入流程,以及移除基于不安全 any 的 Electron API 访问模式。
Original summary in English

Summary by Sourcery

Tighten Electron API typing and usage across the frontend, replace unsafe any casts and direct fetch calls with typed helpers, and improve user-facing storage clearing and log export flows.

New Features:

  • Expose a typed appRestart Electron API for controlled application restarts from the frontend.
  • Introduce a typed LogExportResult contract for log export operations and propagate it to all consumers.

Bug Fixes:

  • Ensure log export consumers handle the full structured result from the main process, including messages and zip paths.
  • Improve backend restart behavior by using the typed application restart API and keeping fallbacks consistent when Electron capabilities are unavailable.

Enhancements:

  • Replace browser native confirm/alert in devtools storage clearing with Ant Design Vue modal and toast messaging.
  • Align Electron preload and type declarations for file selection and logging to use shared Electron FileFilter and unknown logger argument types instead of any.
  • Route script configuration import through the useScriptApi composable to centralize business logic and keep Vue pages lean.
  • Standardize frontend usage of window.electronAPI to rely on typed APIs rather than any assertions in initialization, backend control, settings, history, and editor views.

Tests:

  • Add Vitest suites to assert Electron API typing contracts, log export result structure, script config import flow, and removal of unsafe any-based Electron API access patterns.

@sourcery-ai

sourcery-ai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

此 PR 在前端进一步收紧 Electron API 的类型及其使用方式,引入测试来强制这些约定,统一 Electron 调用,移除对 any 的类型断言,并重构脚本配置导入和存储清理的 UX,使其使用共享的 composable 以及 Ant Design Vue 的反馈组件。

通过 useScriptApi 进行脚本配置导入流程的序列图

sequenceDiagram
  actor User
  participant MaaEndUserEdit
  participant useScriptApi
  participant Service

  User->>MaaEndUserEdit: click handleImportMaaEndConfig
  MaaEndUserEdit->>useScriptApi: importScriptConfigFile(scriptId, userId)
  useScriptApi->>Service: importScriptConfigFileApiScriptsConfigImportPost({ scriptId, userId })
  Service-->>useScriptApi: response(code, message)
  useScriptApi->>useScriptApi: [response.code !== 200] throw Error
  useScriptApi-->>MaaEndUserEdit: resolved response
  MaaEndUserEdit->>MaaEndUserEdit: message.success('已导入...配置文件')
Loading

使用 Ant Design Vue Modal 和 message 进行存储清理的序列图

sequenceDiagram
  actor User
  participant QuickNavPage
  participant Modal
  participant BrowserStorage as localStorage_sessionStorage_IndexedDB
  participant message

  User->>QuickNavPage: click clearStorage
  QuickNavPage->>Modal: Modal.confirm({ onOk })
  Modal-->>User: show confirmation dialog
  User->>Modal: confirm
  Modal->>QuickNavPage: invoke onOk()
  QuickNavPage->>BrowserStorage: localStorage.clear()
  QuickNavPage->>BrowserStorage: sessionStorage.clear()
  QuickNavPage->>BrowserStorage: [window.indexedDB]
  QuickNavPage->>message: message.success('本地存储已清除,建议刷新页面')
  QuickNavPage->>message: message.error('清除存储失败: ...')
Loading

File-Level Changes

Change Details Files
改进 Electron preload 和类型声明,使用共享的 Electron 类型和更安全的 logger 函数签名。
  • 在 preload 和 selectFile 的类型声明中导入并复用 Electron 的 FileFilter 类型。
  • 定义 LogExportResult 接口并更新 exportLogs 的返回类型,以匹配主进程的约定。
  • 将 getLogger 的参数类型从 any[] 更改为 unknown[],同时更新 preload 和 ElectronAPI 声明。
frontend/electron/preload.ts
frontend/src/types/electron.d.ts
规范前端对 window.electronAPI 的使用,依赖已声明的类型化 API,而不是 (window as any) 类型断言,并引入新的 appRestart 能力。
  • 在初始化、设置、WebSocket、日志、历史记录、模拟器以及各种编辑视图中,将 (window as any).electronAPI(window.electronAPI as any) 的使用替换为直接的 window.electronAPI
  • 将 appRestart 接入 WebSocket 重启流程,使用类型化调用来控制后端。
  • 简化 BackendLaunchPage 中对 Electron API 的引用,统一使用 window.electronAPI。
frontend/src/views/Initialization/index.vue
frontend/src/views/Initialization/components/BackendStartStep.vue
frontend/src/utils/initializationDecision.ts
frontend/src/utils/skippedInitializationStartup.ts
frontend/src/composables/useWebSocket.ts
frontend/src/views/history/useHistoryLogic.ts
frontend/src/views/Logs.vue
frontend/src/views/setting/index.vue
frontend/src/views/setting/TabAdvanced.vue
frontend/src/views/Emulator.vue
frontend/src/views/EditView/Script/GeneralScriptEdit.vue
frontend/src/views/EditView/Script/M9AScriptEdit.vue
frontend/src/views/EditView/Script/MAAScriptEdit.vue
frontend/src/views/EditView/Script/SRCScriptEdit.vue
frontend/src/views/EditView/User/MAAUserEdit.vue
frontend/src/components/devtools/BackendLaunchPage.vue
frontend/src/utils/initializationDecision.ts
frontend/src/utils/skippedInitializationStartup.ts
优化 QuickNavPage 中清理本地存储的用户体验,使用 Ant Design Vue 的 Modal 和 message 反馈组件替代原生的 confirm/alert。
  • 在 QuickNavPage 中从 Ant Design Vue 导入 Modal 和 message。
  • 用 Modal.confirm、结构化日志以及成功/失败提示消息替换基于 confirm/alert 的 clearStorage 流程。
  • 为存储操作增加健壮的错误处理,并保持与 logger 的集成。
frontend/src/components/devtools/QuickNavPage.vue
将脚本配置导入逻辑封装进 useScriptApi,并在 MaaEndUserEdit 中使用该逻辑,而不是临时的 fetch 调用。
  • 在 useScriptApi 中新增 importScriptConfigFile 函数,包装 Service.importScriptConfigFileApiScriptsConfigImportPost,并包含错误处理。
  • 在该 composable 的公开 API 中暴露 importScriptConfigFile。
  • 更新 MaaEndUserEdit,使其使用 importScriptConfigFile,而不再直接使用 fetch/OpenAPI,从而简化该 Vue 页面中的业务逻辑。
frontend/src/composables/useScriptApi.ts
frontend/src/views/EditView/User/MaaEndUserEdit.vue
添加 Vitest 测试,用于在代码库中强制 Electron 类型、API 使用模式,以及脚本导入/日志导出约定。
  • 新增测试,确保类型化的 Electron API 使用方不会在 window.electronAPI 上使用 as any 类型断言。
  • 添加测试,验证 LogExportResult 字段,以及 Logs/TabAdvanced 视图使用类型化的 Electron API。
  • 添加测试,验证 useScriptApi 对 importScriptConfig 服务进行了封装,并且 MaaEndUserEdit 不再直接使用 fetch/OpenAPI。
  • 创建测试,检查与初始化相关的使用方是否使用已声明的 Electron API。
  • 添加测试,确保 preload/electron.d.ts 共享 FileFilter 的使用方式,并避免 any[] 类型的 logger 参数。
  • 添加测试,确认 QuickNavPage 使用 Ant Design Vue 的 Modal/message,而不是原生的 confirm/alert。
frontend/src/types/electronApiConsumers.test.ts
frontend/src/types/logExportContract.test.ts
frontend/src/composables/useScriptApiImport.test.ts
frontend/src/types/initializationElectronConsumers.test.ts
frontend/src/types/webSocketElectronApi.test.ts
frontend/src/types/electronTypes.test.ts
frontend/src/components/devtools/QuickNavPage.test.ts

Tips and commands

Interacting with Sourcery

  • 触发新的代码审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 回复 Sourcery 的某条审查评论,请它基于该评论创建 issue;也可以直接回复该评论并写上 @sourcery-ai issue 来创建 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写上 @sourcery-ai,即可随时生成标题。也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文的任意位置写上 @sourcery-ai summary,即可在对应位置生成 PR 摘要。也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 一次性解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不希望再看到它们,这会很有用。
  • 取消所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可取消所有现有的 Sourcery 审查。如果你希望从一个全新的审查开始,这尤其有用——别忘了再评论 @sourcery-ai review 来触发新审查!

Customizing Your Experience

访问你的 dashboard 来:

  • 启用或禁用审查特性,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

This PR tightens the Electron API typing and its usage across the frontend, introduces tests to enforce those contracts, standardizes Electron calls away from any casts, and refactors script config import and storage clearing UX to use shared composables and Ant Design Vue feedback components.

Sequence diagram for script config import flow via useScriptApi

sequenceDiagram
  actor User
  participant MaaEndUserEdit
  participant useScriptApi
  participant Service

  User->>MaaEndUserEdit: click handleImportMaaEndConfig
  MaaEndUserEdit->>useScriptApi: importScriptConfigFile(scriptId, userId)
  useScriptApi->>Service: importScriptConfigFileApiScriptsConfigImportPost({ scriptId, userId })
  Service-->>useScriptApi: response(code, message)
  useScriptApi->>useScriptApi: [response.code !== 200] throw Error
  useScriptApi-->>MaaEndUserEdit: resolved response
  MaaEndUserEdit->>MaaEndUserEdit: message.success('已导入...配置文件')
Loading

Sequence diagram for storage clearing with Ant Design Vue Modal and message

sequenceDiagram
  actor User
  participant QuickNavPage
  participant Modal
  participant BrowserStorage as localStorage_sessionStorage_IndexedDB
  participant message

  User->>QuickNavPage: click clearStorage
  QuickNavPage->>Modal: Modal.confirm({ onOk })
  Modal-->>User: show confirmation dialog
  User->>Modal: confirm
  Modal->>QuickNavPage: invoke onOk()
  QuickNavPage->>BrowserStorage: localStorage.clear()
  QuickNavPage->>BrowserStorage: sessionStorage.clear()
  QuickNavPage->>BrowserStorage: [window.indexedDB]
  QuickNavPage->>message: message.success('本地存储已清除,建议刷新页面')
  QuickNavPage->>message: message.error('清除存储失败: ...')
Loading

File-Level Changes

Change Details Files
Improve Electron preload and type declarations to use shared Electron types and safer logger signatures.
  • Import and reuse Electron FileFilter type in preload and type declarations for selectFile.
  • Define a LogExportResult interface and update exportLogs return type to match main-process contract.
  • Change getLogger argument types from any[] to unknown[] in both preload and ElectronAPI declaration.
frontend/electron/preload.ts
frontend/src/types/electron.d.ts
Standardize frontend usage of window.electronAPI to rely on typed API instead of (window as any) casts, including new appRestart capability.
  • Replace (window as any).electronAPI and (window.electronAPI as any) usage with direct window.electronAPI across initialization, settings, websocket, logs, history, emulator, and various edit views.
  • Wire appRestart into the WebSocket restart flow with typed calls for backend control.
  • Simplify BackendLaunchPage Electron API reference to use window.electronAPI.
frontend/src/views/Initialization/index.vue
frontend/src/views/Initialization/components/BackendStartStep.vue
frontend/src/utils/initializationDecision.ts
frontend/src/utils/skippedInitializationStartup.ts
frontend/src/composables/useWebSocket.ts
frontend/src/views/history/useHistoryLogic.ts
frontend/src/views/Logs.vue
frontend/src/views/setting/index.vue
frontend/src/views/setting/TabAdvanced.vue
frontend/src/views/Emulator.vue
frontend/src/views/EditView/Script/GeneralScriptEdit.vue
frontend/src/views/EditView/Script/M9AScriptEdit.vue
frontend/src/views/EditView/Script/MAAScriptEdit.vue
frontend/src/views/EditView/Script/SRCScriptEdit.vue
frontend/src/views/EditView/User/MAAUserEdit.vue
frontend/src/components/devtools/BackendLaunchPage.vue
frontend/src/utils/initializationDecision.ts
frontend/src/utils/skippedInitializationStartup.ts
Refine UX for local storage clearing in QuickNavPage using Ant Design Vue modal and message feedback instead of native confirm/alert.
  • Import Modal and message from Ant Design Vue in QuickNavPage.
  • Replace confirm/alert-based clearStorage flow with Modal.confirm, structured logging, and success/error toast messages.
  • Add robust error handling for storage operations and keep logger integration.
frontend/src/components/devtools/QuickNavPage.vue
Encapsulate script configuration import logic into useScriptApi and use it from MaaEndUserEdit instead of ad-hoc fetch calls.
  • Add importScriptConfigFile function to useScriptApi that wraps Service.importScriptConfigFileApiScriptsConfigImportPost with error handling.
  • Expose importScriptConfigFile from the composable’s public API.
  • Update MaaEndUserEdit to consume importScriptConfigFile instead of using fetch/OpenAPI directly, simplifying the Vue page’s business logic.
frontend/src/composables/useScriptApi.ts
frontend/src/views/EditView/User/MaaEndUserEdit.vue
Add Vitest tests to enforce Electron typing, API usage patterns, and script import/log export contracts in the codebase.
  • Introduce tests that ensure typed Electron API consumers do not use as any casts on window.electronAPI.
  • Add tests verifying LogExportResult fields and that Logs/TabAdvanced views use the typed Electron API.
  • Add tests that validate useScriptApi wraps the importScriptConfig service and that MaaEndUserEdit no longer uses fetch/OpenAPI directly.
  • Create tests that check initialization-related consumers use the declared Electron API.
  • Add tests to ensure preload/electron.d.ts share FileFilter usage and avoid any[] logger signatures.
  • Add tests to confirm QuickNavPage uses Ant Design Vue Modal/message instead of native confirm/alert.
frontend/src/types/electronApiConsumers.test.ts
frontend/src/types/logExportContract.test.ts
frontend/src/composables/useScriptApiImport.test.ts
frontend/src/types/initializationElectronConsumers.test.ts
frontend/src/types/webSocketElectronApi.test.ts
frontend/src/types/electronTypes.test.ts
frontend/src/components/devtools/QuickNavPage.test.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并且留下了一些整体反馈:

  • QuickNavPage.vueclearStorage 中,onOk 处理函数在记录日志并展示错误消息之后又重新抛出了错误,这可能会在 UI 中表现为未捕获异常;建议在回调中完整处理错误(日志 + 用户反馈),不要重新抛出。
  • 现在有多个调用点直接使用 window.electronAPI 而没有进行存在性检查(例如初始化流程和后端启动相关组件),在非 Electron 环境或配置错误的环境中可能导致运行时错误;建议在 API 可能不可用的地方使用可选链或显式守卫并提供用户反馈。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `clearStorage` on `QuickNavPage.vue`, the `onOk` handler rethrows errors after logging and showing a message, which may surface as uncaught exceptions in the UI; consider handling the error entirely in the callback (log + user feedback) without rethrowing.
- Several call sites now use `window.electronAPI` directly without existence checks (e.g., initialization flow and backend start components), which can cause runtime errors in non‑Electron or misconfigured environments; consider using optional chaining or explicit guards and user feedback where the API might be unavailable.

## Individual Comments

### Comment 1
<location path="frontend/src/components/devtools/QuickNavPage.vue" line_range="142-151" />
<code_context>
+    okText: '清除',
+    okType: 'danger',
+    cancelText: '取消',
+    onOk: () => {
+      try {
+        localStorage.clear()
+        sessionStorage.clear()
+        // 清除IndexedDB(如果有)
+        if (window.indexedDB) {
+          // 这里可以添加更复杂的IndexedDB清理逻辑
+        }
+        logger.info('本地存储已清除')
+        message.success('本地存储已清除,建议刷新页面')
+      } catch (error) {
+        const errorMsg = error instanceof Error ? error.message : String(error)
+        logger.error(`清除存储失败: ${errorMsg}`)
+        message.error(`清除存储失败: ${errorMsg}`)
+        throw error
       }
-      logger.info('本地存储已清除')
</code_context>
<issue_to_address>
**issue (bug_risk):** 避免在 Modal 确认回调中展示错误消息后再次重新抛出错误

在这个 `onOk` 处理函数中,错误已经通过 `message.error` 记录并展示,因此重新抛出可能会在 `Modal.confirm` 中导致未处理的 Promise 拒绝或意外的 UI 错误。相反,应将其视为已处理的错误并省略 `throw`,或者在明确需要时返回一个被拒绝的 Promise,并确保调用方适当地处理它。
</issue_to_address>

Sourcery 对开源项目免费 —— 如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进后续的代码审查。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In clearStorage on QuickNavPage.vue, the onOk handler rethrows errors after logging and showing a message, which may surface as uncaught exceptions in the UI; consider handling the error entirely in the callback (log + user feedback) without rethrowing.
  • Several call sites now use window.electronAPI directly without existence checks (e.g., initialization flow and backend start components), which can cause runtime errors in non‑Electron or misconfigured environments; consider using optional chaining or explicit guards and user feedback where the API might be unavailable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `clearStorage` on `QuickNavPage.vue`, the `onOk` handler rethrows errors after logging and showing a message, which may surface as uncaught exceptions in the UI; consider handling the error entirely in the callback (log + user feedback) without rethrowing.
- Several call sites now use `window.electronAPI` directly without existence checks (e.g., initialization flow and backend start components), which can cause runtime errors in non‑Electron or misconfigured environments; consider using optional chaining or explicit guards and user feedback where the API might be unavailable.

## Individual Comments

### Comment 1
<location path="frontend/src/components/devtools/QuickNavPage.vue" line_range="142-151" />
<code_context>
+    okText: '清除',
+    okType: 'danger',
+    cancelText: '取消',
+    onOk: () => {
+      try {
+        localStorage.clear()
+        sessionStorage.clear()
+        // 清除IndexedDB(如果有)
+        if (window.indexedDB) {
+          // 这里可以添加更复杂的IndexedDB清理逻辑
+        }
+        logger.info('本地存储已清除')
+        message.success('本地存储已清除,建议刷新页面')
+      } catch (error) {
+        const errorMsg = error instanceof Error ? error.message : String(error)
+        logger.error(`清除存储失败: ${errorMsg}`)
+        message.error(`清除存储失败: ${errorMsg}`)
+        throw error
       }
-      logger.info('本地存储已清除')
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid rethrowing after showing an error message in the Modal confirm handler

In this `onOk` handler, errors are already logged and shown via `message.error`, so rethrowing can result in an unhandled rejection or unexpected UI error in `Modal.confirm`. Instead, treat this as a handled error and omit the `throw`, or deliberately return a rejected Promise and ensure callers handle it appropriately.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +142 to +151
onOk: () => {
try {
localStorage.clear()
sessionStorage.clear()
// 清除IndexedDB(如果有)
if (window.indexedDB) {
// 这里可以添加更复杂的IndexedDB清理逻辑
}
logger.info('本地存储已清除')
message.success('本地存储已清除,建议刷新页面')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): 避免在 Modal 确认回调中展示错误消息后再次重新抛出错误

在这个 onOk 处理函数中,错误已经通过 message.error 记录并展示,因此重新抛出可能会在 Modal.confirm 中导致未处理的 Promise 拒绝或意外的 UI 错误。相反,应将其视为已处理的错误并省略 throw,或者在明确需要时返回一个被拒绝的 Promise,并确保调用方适当地处理它。

Original comment in English

issue (bug_risk): Avoid rethrowing after showing an error message in the Modal confirm handler

In this onOk handler, errors are already logged and shown via message.error, so rethrowing can result in an unhandled rejection or unexpected UI error in Modal.confirm. Instead, treat this as a handled error and omit the throw, or deliberately return a rejected Promise and ensure callers handle it appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant