Skip to content

fix(maafw): Mirror 酱查版本一律带 os/arch,分平台发布的项目不再报 8001(beta.5 热修) - #794

Merged
qiyinxi merged 1 commit into
release/v5.5.0-beta.5from
fix/maafw-mirrorchyan-os-arch-b5-20260915
Sep 15, 2026
Merged

qiyinxi merged 1 commit into
release/v5.5.0-beta.5from
fix/maafw-mirrorchyan-os-arch-b5-20260915

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

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 maafw 224 passed;pytest tests --collect-only -q 951 collected 退出码 0;ruff 改动文件全绿。

「检查 CHANGELOG.md 与生成物一致」红是 release 分支上 #713 之前的旧检查(要求改 CHANGELOG.md);按 #761 先例只放 changelog.d/ 碎片,不动 CHANGELOG.md。

🤖 Generated with Claude Code

Sourcery 摘要

通过一致地识别目标操作系统和架构,修复针对特定平台的 MirrorChyan 项目的 MFW 更新检查问题。

错误修复:

  • 确保 MirrorChyan 版本检查始终包含 Windows 和 x86_64 平台参数,避免按平台发布的项目更新失败。

测试:

  • 增加测试覆盖,确认无论接口的多平台设置如何,都会发送平台参数。
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:

  • Ensure MirrorChyan version checks always include Windows and x86_64 platform parameters, preventing update failures for projects published per platform.

Tests:

  • Add coverage confirming platform parameters are sent regardless of the interface's multiplatform setting.

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)
@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

审查者指南

此热修复通过为所有项目发送 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()
Loading

文件级变更

变更 详情 文件
在 MirrorChyan 最新版本请求中始终包含 Windows x86_64 平台参数,不受接口元数据标志影响。
  • 移除了基于 mirrorchyan_multiplatform 的条件处理。
  • 无条件添加 os=win 和 arch=x86_64 查询参数,以防止平台特定发布导致 8001 错误。
  • 更新诊断日志,使其始终报告所查询的平台。
app/task/MaaFW/tools/core/automas_maafw_project_update/updater.py
增加回归测试,验证对于每个 mirrorchyan_multiplatform 值都会发送平台参数。
  • 模拟异步 HTTP 客户端,并断言请求路径、版本、平台参数以及明文 CDK 不存在。
  • 针对元数据值缺失、false 和 true 分别进行参数化测试。
tests/task/test_maafw_project_update_mirrorchyan_query.py
在变更日志中记录 beta.5 修复。
  • 增加面向用户的条目,说明影响 MAA_Punish 等平台特定项目的更新检查失败问题。
changelog.d/maafw-mirrorchyan-os-arch.fix.md

提示和命令

与 Sourcery 互动

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以使用 @sourcery-ai issue 回复审查评论,以根据该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时生成或重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可在你指定的位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时生成或重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时生成或重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从头开始进行新的审查,这尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义你的体验

访问你的 控制面板:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

This 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 fix

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()
Loading

File-Level Changes

Change Details Files
Always include Windows x86_64 platform parameters in MirrorChyan latest-version requests, independent of the interface metadata flag.
  • Removed conditional handling based on mirrorchyan_multiplatform.
  • Added unconditional os=win and arch=x86_64 query parameters to prevent 8001 errors for platform-specific releases.
  • Updated diagnostic logging to consistently report the queried platform.
app/task/MaaFW/tools/core/automas_maafw_project_update/updater.py
Added regression coverage proving platform parameters are sent for every mirrorchyan_multiplatform value.
  • Mocked the async HTTP client and asserted the request path, version, platform parameters, and absence of plaintext CDK.
  • Parameterized the test across missing, false, and true metadata values.
tests/task/test_maafw_project_update_mirrorchyan_query.py
Documented the beta.5 fix in the changelog.
  • Added a user-facing entry for update-check failures affecting platform-specific projects such as MAA_Punish.
changelog.d/maafw-mirrorchyan-os-arch.fix.md

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.

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

需要人工审阅。 如果 MirrorChyan 对固定参数的理解有误,更新程序可能会在代码回滚之前选择或安装不合适的平台软件包。由此产生的客户端更新会在回滚后继续存在,不过影响范围有限,通常可以通过发布正确的后续更新来修复。


Sourcery 对开源项目免费——如果你喜欢我们的审阅结果,请考虑分享 ✨
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.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@qiyinxi
qiyinxi merged commit c58c9bf into release/v5.5.0-beta.5 Sep 15, 2026
4 of 5 checks passed
@qiyinxi
qiyinxi deleted the fix/maafw-mirrorchyan-os-arch-b5-20260915 branch September 15, 2026 16:48
1w1w11w1 added a commit that referenced this pull request Sep 16, 2026
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>
ClozyA pushed a commit that referenced this pull request Sep 16, 2026
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>
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