fix(maafw): Mirror 酱查版本一律带 os/arch,分平台发布的项目不再报 8001(beta.5 热修) - #794
Conversation
interface.json 的 mirrorchyan_multiplatform 只是发布方给打包器的提示, MAA_Punish 这类分平台发布的项目并没有写它;Mirror 酱对分平台 rid 不带 os/arch 直接回 8001「对应架构和系统下的资源不存在」,运行前更新检查整条 失败。线上实测单平台 rid(AUTO_MAS)多带这两个参数照常回 200,所以不再 按该字段分支。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 310468e)
审查者指南此热修复通过为所有项目发送 os/arch,使 MFW 的 MirrorChyan 更新查询始终针对 Windows x86_64,从而避免在 interface.json 未反映平台特定发布时出现 8001 resource-not-found 响应,并增加了针对性的回归测试和变更日志文档。 MFW MirrorChyan 更新查询修复的时序图sequenceDiagram
participant MFW as MFW Updater
participant MirrorChyan
MFW->>MFW: _query_mirrorchyan_latest()
MFW->>MirrorChyan: GET /api/resources/{rid}/latest?os=win&arch=x86_64
MirrorChyan-->>MFW: 200 latest resource
MFW->>MFW: _discover_project_update_detailed()
文件级变更
提示和命令与 Sourcery 互动
自定义你的体验访问你的 控制面板:
获取帮助Original review guide in EnglishReviewer's GuideThis hotfix makes MFW’s MirrorChyan update lookup consistently target Windows x86_64 by sending os/arch for all projects, avoiding 8001 resource-not-found responses when platform-specific publishing is not reflected in interface.json, with focused regression tests and changelog documentation. Sequence diagram for the MFW MirrorChyan update lookup fixsequenceDiagram
participant MFW as MFW Updater
participant MirrorChyan
MFW->>MFW: _query_mirrorchyan_latest()
MFW->>MirrorChyan: GET /api/resources/{rid}/latest?os=win&arch=x86_64
MirrorChyan-->>MFW: 200 latest resource
MFW->>MFW: _discover_project_update_detailed()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
你好——我已经审阅了你的更改,整体看起来很棒!
Sourcery 评估
需要人工审阅。 如果 MirrorChyan 对固定参数的理解有误,更新程序可能会在代码回滚之前选择或安装不合适的平台软件包。由此产生的客户端更新会在回滚后继续存在,不过影响范围有限,通常可以通过发布正确的后续更新来修复。
Original comment in English
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the fixed parameters are interpreted incorrectly by MirrorChyan, the updater could select or install an inappropriate platform package before the code is reverted. The resulting client updates would outlive the revert, though the impact is bounded and can generally be repaired by issuing a correct follow-up update.
cherry-pick #734(`432720d3`)到 `release/v5.5.0-beta.5`:分支从 release 分支切出、只 cherry-pick 那一个提交,merge-base 就是 release 分支当前 HEAD(`cf0d6918`),补丁与 dev 提交逐字相同。 修复库存保持任务刷到的材料未计入掉落统计的问题(「养成计划」同类问题一并覆盖):MAA 从 v6.17.3 起给库存保持/养成计划这类多链任务的完成行追加 ` #N` 序号后缀,MAS 侧用精确相等比对,`库存保持 #1` 匹配不上 `库存保持`,整段任务区间被丢弃,掉落随之漏计。任务名比对改为容忍该序号后缀;旧裸任务名与仓库识别链行为完全不变。 ## 验证 - Cherry-pick 后相对 `release/v5.5.0-beta.5` 仅 2 文件:`app/core/config.py`(+7/-1)、changelog 碎片 - 修复前后实测对比(本分支检出,同一条 MAA 日志):`库存保持 #1` / `养成计划 #1` 由漏计变为计入;旧裸任务名 `库存保持` 与识别链 `库存保持 (仓库识别)` 结果逐字不变 - `python -m pytest tests/core -q`:48 passed - `python -m pytest tests --collect-only -q`:963 collected,exit 0 - `ruff check app/core/config.py`:All checks passed - 按 #761、#794 先例只放 `changelog.d/` 碎片,不动 `CHANGELOG.md`、`res/version.json` 与版本号 ## 说明 该解析函数在 `tests/` 中原本没有用例(原提交按 `tests/AGENTS.md` 的 bug 边界规则未随 PR 提交测试),本次 cherry-pick 同样不新增测试,上述对比为临时验证。 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Sourcery 摘要 修复 MAA 多链任务完成记录的名称解析,使相关任务掉落能够正确纳入统计。 错误修复: - 修复多链任务名称带序号后缀时掉落材料未计入统计的问题,并覆盖库存保持与养成计划任务。 功能增强: - 保持旧版裸任务名及仓库识别链的掉落统计行为不变。 杂项: - 新增对应的变更日志条目。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery 修复 MAA 多链任务完成记录的名称解析,使相关任务掉落能够正确纳入统计。 Bug Fixes: - 修复多链任务名称带序号后缀时掉落材料未计入统计的问题,并覆盖库存保持与养成计划任务。 Enhancements: - 保持旧版裸任务名及仓库识别链的掉落统计行为不变。 Chores: - 新增对应的变更日志条目。 </details> Co-authored-by: Ji Mao Cai <44921326+jinghero@users.noreply.github.com>
Cherry-pick #818(`d8ded302`)到 `release/v5.5.0-beta.5`:分支从 release 分支切出、只 cherry-pick 那一个提交,补丁与 dev 提交逐字相同。 Mirror 酱对 `release_note` 有长度上限,更新日志过长时返回的首行是被截断的、没有结尾 `-->` 的不完整 JSON。这条例外在 `check_update` 里没有兜底,整条更新检查随之失败:标题栏不显示「检测到更新」,手动检查只报一句解析错误,用户完全看不到新版本。beta 通道的更新日志目前已经长到会被截断,beta.5 用户必然踩到。 - 更新日志解析失败只丢日志本身,更新检查照常返回「需要更新 + 最新版本号」 - 版本信息里缺 `data` 时给一句可读提示,不再漏出 `KeyError` - 更新弹窗的日志空态改为「更新日志加载失败,可直接下载更新」 ## 验证 - 真实 Mirror 酱响应(channel=beta,当前 v5.5.0-beta.5):`release_note` 恰好 20000 字符、单行、未闭合;修复前抛 JSONDecodeError,修复后 `check_update` 返回 `(True, "v5.5.0-beta.6", {})`,标题栏与弹窗都恢复正常 - 真实完整日志(channel=stable):9 个版本段照常解析与筛选,分类与条目不变 - `parse_release_note` 对 `None` / 空串 / 非字符串 / 非字典 JSON / `placeholder` 一律返回 `{}`,合法 JSON 正常返回 - Cherry-pick 后相对 `release/v5.5.0-beta.5` 仅 6 文件:`app/services/update.py`、`frontend/src/components/UpdateModal.vue`、三份词表与 changelog 碎片 - `python -m pytest tests/services -q`:66 passed - `python -m pytest tests --collect-only -q`:1406 collected,exit 0 - `ruff check app/services/update.py`:All checks passed - `yarn lint`:0 errors;`yarn typecheck` 与 dev 基线逐条一致,无新增错误 - 按 #761、#794、#816 先例只放 `changelog.d/` 碎片,不动 `CHANGELOG.md`、`res/version.json` 与版本号 ## Sourcery 摘要 即使发行说明被截断或不可用,也能继续正常检测更新,同时提供更清晰的备用提示信息。 Bug 修复: - 防止截断或无效的发行说明导致更新检查失败,确保仍能显示新版本通知并提供下载。 - 当更新响应数据不完整时,显示易读的错误信息,而不是暴露 `KeyError`。 - 当更新日志加载失败时,显示清晰的本地化提示信息。 杂项: - 为更新检查修复添加更新日志条目。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Keep update detection working when release notes are truncated or unavailable, while providing clearer fallback messaging. Bug Fixes: - Prevent truncated or invalid release notes from causing update checks to fail, preserving new-version notifications and download availability. - Report incomplete update response data with a readable error instead of exposing a KeyError. - Show a clear localized message when update changelog loading fails. Chores: - Add a changelog entry for the update-check fix. </details>
cherry-pick #792(
310468e4e)到release/v5.5.0-beta.5:分支从 release 分支切出、只 cherry-pick 那一个提交,merge-base 就是 release 分支当前 HEAD(8506f30bb),补丁与 dev 提交逐字相同。修复 MFW 项目运行前检查更新时报
MirrorChyan [8001]: 对应架构和系统下的资源不存在:Mirror 酱查版本一律带os/arch,不再看interface.json的mirrorchyan_multiplatform(MAA_Punish 分平台发布却没写它)。根因与线上实测见 #792。验证(本分支检出):
pytest tests/task -k maafw224 passed;pytest tests --collect-only -q951 collected 退出码 0;ruff 改动文件全绿。「检查 CHANGELOG.md 与生成物一致」红是 release 分支上 #713 之前的旧检查(要求改 CHANGELOG.md);按 #761 先例只放
changelog.d/碎片,不动 CHANGELOG.md。🤖 Generated with Claude Code
Sourcery 摘要
通过一致地识别目标操作系统和架构,修复针对特定平台的 MirrorChyan 项目的 MFW 更新检查问题。
错误修复:
测试:
Original summary in English
Summary by Sourcery
Fix MFW update checks for platform-specific MirrorChyan projects by consistently identifying the target operating system and architecture.
Bug Fixes:
Tests: