Repository navigation
feat: 支持每日定时检查更新 - #399
Open
moranfanhua wants to merge 2 commits into
Open
feat: 支持每日定时检查更新#399moranfanhua wants to merge 2 commits into
moranfanhua wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
嗨——我发现了 2 个问题
提供给 AI 智能体的提示
请处理此代码审查中的评论:
## 单条评论
### 评论 1
<location path="src/App.tsx" line_range="564" />
<code_context>
+ };
+
+ const checkForScheduledUpdate = async () => {
+ if (scheduledUpdateCheckInProgressRef.current || isUpdateBusy()) return;
+ scheduledUpdateCheckInProgressRef.current = true;
+ const { mirrorChyanSettings, proxySettings } = useAppStore.getState();
</code_context>
<issue_to_address>
**手动检查结果会被覆盖**
当计划检查请求正在进行时启动手动检查,并且手动检查先完成,`checkForScheduledUpdate` 并未设置 `updateCheckLoading`,因此手动检查仍处于可用状态;手动检查结果可能先返回,随后计划检查结果传入 `handleAutoUpdateCheckResult` 并覆盖手动检查结果,或意外启动自动下载。调用方会看到相互冲突的结果,或发生未经请求的下载。
为计划检查发布一个共享的进行中状态,防止手动检查与其发生竞争。
</issue_to_address>
### 评论 2
<location path="src/stores/appStore.ts" line_range="1385-1386" />
<code_context>
confirmBeforeDelete: config.settings.confirmBeforeDelete ?? false,
maxLogsPerInstance: config.settings.maxLogsPerInstance ?? DEFAULT_MAX_LOGS_PER_INSTANCE,
autoClearLogsOnLaunch: config.settings.autoClearLogsOnLaunch ?? true,
+ scheduledUpdateCheckEnabled: config.settings.scheduledUpdateCheckEnabled === true,
+ scheduledUpdateCheckTime: normalizeScheduledUpdateCheckTime(
+ config.settings.scheduledUpdateCheckTime,
+ ),
</code_context>
<issue_to_address>
**计划检查偏好设置会丢失**
当保存的配置中没有任何实例时,`loadInterface` 会跳过 `importConfig(config)`,因此计划检查设置会保留默认值;重启后,计划检查会被禁用,保存的时间也可能丢失。
即使配置中没有实例,也要加载计划检查设置。
</issue_to_address>Original comment in English
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/App.tsx" line_range="564" />
<code_context>
+ };
+
+ const checkForScheduledUpdate = async () => {
+ if (scheduledUpdateCheckInProgressRef.current || isUpdateBusy()) return;
+ scheduledUpdateCheckInProgressRef.current = true;
+ const { mirrorChyanSettings, proxySettings } = useAppStore.getState();
</code_context>
<issue_to_address>
**Manual results get overwritten**
When a manual check starts while a scheduled request is in flight and finishes first, `checkForScheduledUpdate` does not set `updateCheckLoading`, so the manual check remains enabled; its result can finish first, after which the scheduled result reaches `handleAutoUpdateCheckResult` and overwrites it or starts an unexpected automatic download. The caller sees conflicting results or an unrequested download.
Publish a shared in-progress state for scheduled checks so manual checks cannot race with them.
</issue_to_address>
### Comment 2
<location path="src/stores/appStore.ts" line_range="1385-1386" />
<code_context>
confirmBeforeDelete: config.settings.confirmBeforeDelete ?? false,
maxLogsPerInstance: config.settings.maxLogsPerInstance ?? DEFAULT_MAX_LOGS_PER_INSTANCE,
autoClearLogsOnLaunch: config.settings.autoClearLogsOnLaunch ?? true,
+ scheduledUpdateCheckEnabled: config.settings.scheduledUpdateCheckEnabled === true,
+ scheduledUpdateCheckTime: normalizeScheduledUpdateCheckTime(
+ config.settings.scheduledUpdateCheckTime,
+ ),
</code_context>
<issue_to_address>
**Scheduled preferences are lost**
When the saved configuration has no instances, `loadInterface` skips `importConfig(config)`, so the scheduled-check settings stay at their defaults; after restart, scheduled checks are disabled and the saved time can be lost.
Load the scheduled-check settings even when the configuration has no instances.
</issue_to_address>- 在更新设置中增加定时检查开关,默认关闭,时间默认为 08:00 - 将开关和时间独立保存到应用设置,修改后立即重排每日检查 - 复用更新结果处理,保持原有启动检查及自动任务挂起行为 - 仅为定时入口增加并发与参数变化校验,并同步五种语言文案 关联 MaaXYZ#358 验证:构建、类型及格式检查通过,启动逻辑通过与原代码的 16 种模拟场景对照。
moranfanhua
force-pushed
the
feat/scheduled-update-check
branch
from
October 23, 2026 16:56
736a063 to
5a4c3e9
Compare
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.
close: #358,ref: MaaEnd/MaaEnd#5326
Sourcery 总结
支持从桌面应用程序启用可选的每日更新检查,并提供可配置的计划安排和持久化设置。
新功能:
增强功能:
Original summary in English
Sourcery 摘要
为桌面应用启用可配置的每日更新检查,并使其与现有更新流程协调运行。
新功能:
改进:
Original summary in English
Summary by Sourcery
Enable configurable daily update checks for the desktop application while coordinating them with existing update flows.
New Features:
Enhancements: