Repository navigation
修正区间更新的清单来源、整包回退和大文件内存占用 - #147
Merged
qiyinxi merged 3 commits intoNov 13, 2026
Merged
Conversation
清单始终从远端取。变更太多时只记录日志,本地创建、写入、关闭或复制失败时直接报错。 大文件分块写入临时文件,重试前重置内容,解包后关闭并删除。保留区间响应、超时、取消、CRC 和清单核对。 Refs ModAVD/ModAVD#182
读取清单、文件哈希和模拟器信息失败时直接报错,避免把本地错误当成包损坏后重新下载整包。构建暂存目录也要保留清单读取错误。 目标文件关闭失败时优先返回本地错误,避免被同时发生的 ZIP 读取错误盖掉。补充失败回归,保留坏包回退和旧版包兼容。 Refs ModAVD/ModAVD#182
先确认清单和模拟器所需的路径是不是普通文件。包里把文件做成目录时仍按坏包拒绝,删除无效缓存并恢复 Mirror 酱到 GitHub 的回退。 真实本地读取错误仍直接返回并保留有效缓存。旧版可选清单继续使用原有的 ZIP 校验回退。补齐整包、部分增量和旧版的成功、失败与缓存回归。 Refs ModAVD/ModAVD#182
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 13, 2026
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.
区间更新始终从远端取
modavd-manifest.json。变更比例或数量超过阈值时仍下载整包,原因只写日志,不再进入更新成功消息。超过 8 MiB 的条目用 64 KiB 缓冲区写入独立临时文件,重试前回卷并清空,解包后解除引用、关闭并删除。本地创建、写入、关闭、复制和清理失败直接返回。强制核对清单、文件哈希及模拟器信息时也保留本地读取错误,避免误判为包损坏并重复下载整包。构建暂存目录时,清单读取失败不会再被默认构建号掩盖。读取 ZIP 与关闭目标文件同时失败时,优先返回目标文件关闭错误。
保留响应状态、Content-Range、编码、长度、超时、取消、CRC 和清单核对。需要清单的更新中,清单缺失、格式错误或不是普通文件仍视为坏包。模拟器所需文件若被做成目录,也按坏包拒绝并删除缓存,Mirror 酱整包和增量包继续回退到 GitHub。真实本地查询或读取错误仍直接返回并保留有效缓存。旧版可选清单保留原有的无有效清单时按 ZIP 校验的行为。
验证环境为 Windows amd64、仓库要求的 Go 1.26.5。实际运行:
go test ./internal/update ./internal/download ./internal/cli ./internal/ui -count=1。覆盖整包、增量、旧版兼容、真实损坏回退及新增本地错误回归。gofmt -l .、Windows amd64、darwin/arm64、linux/amd64 的go vet ./...、build.ps1通过。TestImageGatesSurviveDirectorySwapAndRecovery/install出现一次路径不存在断言失败;该测试连续复跑 5 次通过,四个受影响包全套重跑也通过。未改镜像或目录切换代码。本地此前运行
go test ./... -count=1时,Go 临时目录的avd.test.exe多次返回Access is denied;单独编译到测试目录、从包目录运行该测试程序通过,生产实例对照项跳过。本轮重新验证了上面四个受影响包。未做物理磁盘写满、真实 GitHub 发布包、模拟器或游戏验收。未改生产实例。本次提交的 CI 六项检查全部通过。
Refs ModAVD/ModAVD#182