Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
你好——我发现了 4 个问题
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/App.tsx" line_range="1116-1117" />
<code_context>
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
setShowInstallConfirmModal(true);
</code_context>
<issue_to_address>
**Update overwrites files during running tasks**
When the UI reloads while a backend task is still running and a pending update exists, `loadInterface` restores backend task states before reaching the pending-update branch, but that branch starts installation without checking whether any instance is running. When the UI reloads while a task is still active, `installUpdate` replaces the target files underneath it and the task can fail or use a mixed version.
Check restored instance run states before starting the update, and defer installation until all tasks have stopped.
</issue_to_address>
### Comment 2
<location path="src/App.tsx" line_range="1115" />
<code_context>
setDownloadSavePath(pendingUpdate.downloadSavePath);
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
</code_context>
<issue_to_address>
**Hidden startup blocks auto-run tasks**
When an executable installer update is pending during an auto-start launch, `InstallConfirmModal` opens the executable installer and leaves the completed modal open without restarting the app; because auto-start mode keeps the window hidden, the user cannot close it, and the deferred auto-start tasks never dispatch.
For hidden auto-start launches, avoid waiting on an interactive modal for executable installers; dispatch the pending tasks or otherwise handle installer completion without requiring the hidden window to be closed.
</issue_to_address>
### Comment 3
<location path="src/App.tsx" line_range="1116-1117" />
<code_context>
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
setShowInstallConfirmModal(true);
</code_context>
<issue_to_address>
**Canceled installer loses pending update**
When a recovered pending update is an executable installer and the user cancels or the external installer fails, `InstallConfirmModal` opens an executable installer and then clears the pending-update record when opening succeeds, before the external installer has actually updated the app. If the user cancels that installer, the app remains on the old version but no longer has the downloaded package marked for installation on the next launch.
Keep the pending update until the app confirms the installed version changed, or restore it when the startup version check finds the old version still installed.
</issue_to_address>
### Comment 4
<location path="src/App.tsx" line_range="1115" />
<code_context>
setDownloadSavePath(pendingUpdate.downloadSavePath);
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
</code_context>
<issue_to_address>
**Settings downloads are not installed at startup**
When a user downloads an update from Settings rather than through the automatic or update-bubble flow, `UpdateSection.startDownload` sets the download status and path but never calls `savePendingUpdateInfo`, so `loadInterface` finds no pending package on the next launch and the update is not installed automatically.
Call `savePendingUpdateInfo` with the completed download’s metadata in the Settings download path as well.
</issue_to_address>Original comment in English
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/App.tsx" line_range="1116-1117" />
<code_context>
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
setShowInstallConfirmModal(true);
</code_context>
<issue_to_address>
**Update overwrites files during running tasks**
When the UI reloads while a backend task is still running and a pending update exists, `loadInterface` restores backend task states before reaching the pending-update branch, but that branch starts installation without checking whether any instance is running. When the UI reloads while a task is still active, `installUpdate` replaces the target files underneath it and the task can fail or use a mixed version.
Check restored instance run states before starting the update, and defer installation until all tasks have stopped.
</issue_to_address>
### Comment 2
<location path="src/App.tsx" line_range="1115" />
<code_context>
setDownloadSavePath(pendingUpdate.downloadSavePath);
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
</code_context>
<issue_to_address>
**Hidden startup blocks auto-run tasks**
When an executable installer update is pending during an auto-start launch, `InstallConfirmModal` opens the executable installer and leaves the completed modal open without restarting the app; because auto-start mode keeps the window hidden, the user cannot close it, and the deferred auto-start tasks never dispatch.
For hidden auto-start launches, avoid waiting on an interactive modal for executable installers; dispatch the pending tasks or otherwise handle installer completion without requiring the hidden window to be closed.
</issue_to_address>
### Comment 3
<location path="src/App.tsx" line_range="1116-1117" />
<code_context>
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
setShowInstallConfirmModal(true);
</code_context>
<issue_to_address>
**Canceled installer loses pending update**
When a recovered pending update is an executable installer and the user cancels or the external installer fails, `InstallConfirmModal` opens an executable installer and then clears the pending-update record when opening succeeds, before the external installer has actually updated the app. If the user cancels that installer, the app remains on the old version but no longer has the downloaded package marked for installation on the next launch.
Keep the pending update until the app confirms the installed version changed, or restore it when the startup version check finds the old version still installed.
</issue_to_address>
### Comment 4
<location path="src/App.tsx" line_range="1115" />
<code_context>
setDownloadSavePath(pendingUpdate.downloadSavePath);
- // 先设置 installStatus,再设置 downloadStatus,
- // 避免 subscribe 在 installStatus 还是 idle 时触发 tryAutoInstallUpdate 造成双发
+ // 启动时安装已下载的更新,完成重启后再执行自动任务。
useAppStore.getState().setInstallStatus('installing');
setDownloadStatus('completed');
</code_context>
<issue_to_address>
**Settings downloads are not installed at startup**
When a user downloads an update from Settings rather than through the automatic or update-bubble flow, `UpdateSection.startDownload` sets the download status and path but never calls `savePendingUpdateInfo`, so `loadInterface` finds no pending package on the next launch and the update is not installed automatically.
Call `savePendingUpdateInfo` with the completed download’s metadata in the Settings download path as well.
</issue_to_address>There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b44806712
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // 更新状态通过气泡展示,已下载的更新在下次启动时自动安装。 | ||
| if (updateInfo?.hasUpdate || updateInfo?.errorCode || downloadStatus === 'downloading') { | ||
| setShowUpdateDialog(true); |
There was a problem hiding this comment.
Persist settings downloads before deferring their installation
When an update is downloaded through desktop Settings—via a manual check, retry, or CDK/source switch—UpdateSection.startDownload only updates the in-memory path and status (src/components/settings/UpdateSection.tsx:158–161); unlike the App and UpdatePanel paths, it never calls savePendingUpdateInfo. With completion-triggered installation removed, the next launch gets null from getPendingUpdateInfo and skips the already-downloaded package, so this workflow no longer installs automatically and can download the same update again. Persist successful Settings downloads too, or centralize persistence, before relying exclusively on startup installation.
AGENTS.md reference: AGENTS.md:L45-L45
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 4892363: The Settings download flow now saves completed update metadata with savePendingUpdateInfo, allowing startup to find and resume that package.
不再闲时更新,改为在启动时统一更新
Ref:
MaaEnd/MaaEnd#7070
MaaEnd/MaaEnd#6808
MaaEnd/MaaEnd#6497
GPT 6A写的,先PR编译一下我测测
同时suppress #400
Sourcery 摘要
将更新安装统一调整至应用启动阶段,并增强旧版自动启动任务迁移的安全校验。
错误修复:
功能增强:
测试:
维护工作:
Original summary in English
Sourcery 摘要
将更新安装移至应用启动时进行,并提高旧版自动启动任务迁移的安全性。
新功能:
错误修复:
改进:
测试:
Original summary in English
Sourcery 摘要
将更新安装统一调整至应用启动阶段,并提升旧版自动启动任务迁移的安全性。
新功能:
错误修复:
改进:
测试:
杂项:
Original summary in English
Summary by Sourcery
将更新安装统一调整至应用启动阶段,并提升旧版自动启动任务迁移的安全性。
New Features:
Bug Fixes:
Enhancements:
Tests:
Chores: