Repository navigation
修复 6 处缺陷,新增 CI 工作流,并完成一轮去重清理 - #1
Merged
Merged
Conversation
…ck paths - ConfigManager: include AutoCheckUpdates in the persistable copy (the whitelist silently dropped it, so the setting reset on every restart); Stage11 now round-trips every LauncherConfig property via reflection so a future field cannot be forgotten again. - GameDirectory.FromConfig: the ".minecraft" default is a sentinel, not a CWD-relative path; both LauncherContext and LaunchSession now resolve it to %AppData%\.minecraft as documented in the README. - HomeViewModel no longer writes the resolved game directory back to the config, which persisted the temporary --game-dir override. - ModsViewModel: reject modrinth.index.json entries that escape the instance directory (zip-slip via SafeCombine). - ImageCache: catch OperationCanceledException so HttpClient timeouts no longer escape the fire-and-forget icon load. - SettingsViewModel: write the downloaded Java path directly into the config before saving instead of racing the 500ms debounced save. - MicrosoftAuthService: poll the device-code token first and delay after, saving one interval when the user has already authorized. - Tests: --scan now exits non-zero when issues are found.
Adds a windows-latest workflow that builds the solution and runs the offline test suite (OML.Test --no-network); previously only tag-triggered releases built anything. Also report the real entry-assembly version in the User-Agent instead of the stale hardcoded OML/0.1 (Modrinth's ToS asks for an identifiable UA).
- AtomicFile.WriteAllTextAsync replaces five copies of the temp-file-then-move pattern. - RunOptiFineInstallerAsync consolidates the OptiFine install flow that was duplicated between RunOptiFineAsync and ImportOptiFinePackageAsync. - LaunchProgressReporter shares the verbatim-identical Report helper and PhaseProgress adapter between LaunchSession and VersionInstaller; the three ensure-methods stay separate because their weights, toggles and failure policies genuinely differ. - Delete confirmed-unreferenced members: DownloadUrls.Rebase, DownloadSource.Priority, InvalidateCache (JavaScanner, BmclApiSourceProvider), MirrorSpeedTester.GetFastestUrlAsync, VersionInheritor.EnumerateStringArguments, VersionRepository.GetLatestReleaseAsync/GetLatestSnapshotAsync, GameDirectory.GetSavesDirectory/GetModsDirectory, LauncherContext.IsInitialized and the never-subscribed ConfigChanged event, along with the test lines that only exercised them.
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.
概述
对代码库做了一轮完整审查,分三个提交交付:缺陷修复、CI 补充、内部重构。全部改动 +193 / −273 行(净减 80 行),构建 0 警告 0 错误,离线测试 185/185 通过;每个提交都可独立构建(bisect 友好)。
缺陷修复(d5f41e8)
CreatePersistableCopy白名单漏掉AutoCheckUpdates.minecraft,而非 README 承诺的%AppData%\.minecraftGameDirectory.FromConfig统一解析哨兵值--game-dir(注释明确说不写回)被永久持久化.mrpack声明路径无包含性校验SafeCombine模式拦截ImageCache的 catch 过滤器漏了OperationCanceledException另有两处小修:设备码登录先请求再等待(授权已完成的用户省一个轮询间隔);
--scan诊断发现异常时正确返回非零退出码。CI 工作流(17c224d)
新增
.github/workflows/ci.yml:push / PR 时在 windows-latest 上构建解决方案并跑离线测试套件(OML.Test --no-network)。此前只有打 tag 的发布流水线,日常推送没有任何构建或测试检查。同时把 User-Agent 从硬编码
OML/0.1改为动态读取入口程序集版本(当前上报OML/1.1.2),发版不用再回头改代码(Modrinth 服务条款要求可识别的 UA)。去重清理(73fe997)
AtomicFile.WriteAllTextAsyncInstallViewModel里逐行重复两份 → 合并为RunOptiFineInstallerAsyncLaunchSession与VersionInstaller逐字相同的Report/PhaseProgress进度上报基础设施 → 提取共享;三个 ensure 方法保留各自实现,因为两边的权重、开关(CompleteAssets)、资源上限、重试与失败通知策略是真实语义差异,强行合并只会变成参数堆砌InvalidateCache×2、GetFastestUrlAsync、Rebase、DownloadSource.Priority等)及仅覆盖这些死代码的 2 条测试断言(离线断言总数 187 → 185)说明
MicrosoftAuthService(等待 Mojang 白名单)按现状保留未动。