Repository navigation
refactor(config): 统一各专项账号配置字段 - #2089
Merged
Merged
Conversation
- 抽出 AccountNameFields / AccountCredentialFields / AccountScriptHookFields / AccountRunFields / AccountRunStatusFields 五个切片,13 个账号配置按需继承, 共有字段只在 shared.py 声明一次 - 删除没有消费方的字段:Info.IfUseMasConfig(General/BetterGI)、Info.Base 与 账号级 Controller/Resource(MaaFW)、Data.IfPassCheck - Info.Id 全部改加密存储;MaaFW 的 Info.Account、ZzzOd 的 Game.Account/Password 并入 Info.Id/Password,旧键按 legacy 迁移 - LastProxyStatus 收成 shared.ProxyStatus 单一 Literal,覆盖运行时真实写入的 维护中/运行中,修复 ZzzOd/Whimbox 写这两个值会校验失败 - 服务器语义字段统一叫 Resource:HSR/SRC 的 Info.Server 改名并 legacy 迁移 - 前端同步改名、删除死字段默认值与写入,API 模型按生成器重新生成 Co-Authored-By: Claude Code <[email protected]>
M9A 迁移直接读原始字典,早于 pydantic 的 legacy 转换,所以改读 Id 之后 仍带 Info.Account 的存量配置会读到空账号,进而在整理队列时丢掉账号。 统一走 _account_of():先 Id 后 Account,密文先解出明文。 另把两处断言依赖真实账号串的 Okww 测试标记为仅在 Windows 运行—— 账号字段加密后依赖 DPAPI,Linux CI 上构造即会抛 UnsupportedPlatformError。 Co-Authored-By: Claude Code <[email protected]>
子进程用 write_text 写心跳,会先截断再写;读者正好撞上就拿到空串,
int("") 直接失败。本机基线就有约 1/5 的偶发失败,CI 上也复现。
改为 read_heartbeat():读到空返回 None,调用方跳过这一拍继续等。
不改成原子写是因为 Windows 上 os.replace 会与正在读取的目标文件冲突,
反而让子进程抛错退出。
Co-Authored-By: Claude Code <[email protected]>
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.
摘要
AccountNameFields/AccountCredentialFields/AccountScriptHookFields/AccountRunFields/AccountRunStatusFields五个字段切片,13 个账号配置按需继承,共有字段只在shared.py声明一次。Info.IfUseMasConfig、Info.Base(MaaFW/BAAH)、MaaFW 账号级Info.Controller/Info.Resource、Data.IfPassCheck。Info.Id全部改为加密存储;Info.Account(MaaFW)、Game.Account/Game.Password(ZzzOd)并入Info.Id/Info.Password,旧键按legacy迁移。LastProxyStatus收成单一 Literal,覆盖运行时真实写入的「维护中」「运行中」;服务器语义字段统一叫Resource(HSR/SRC 的Info.Server改名并迁移)。证据
pytest:542 passed(改动前后均全绿;tests/platform/test_task_process_job.py在单项复跑 3 次与全量中各通过,未复现一次性失败)。yarn typecheck/yarn test(210 passed)/oxfmt --check/oxlint/yarn audit:i18n --check均通过。{"Info":{"Server":"CN-Bilibili"}}→Resource;{"Game":{"Account":"…","Password":"…"}}→Info.Id/Info.Password;{"Info":{"Account":"…"}}→Info.Id,四类均按新字段落位。未知/成功/失败/维护中/运行中五个状态均通过校验。合并风险
legacy迁移,存量 JSON 由框架在输入准备阶段转换;未手工改动任何存量文件。Info.Id下次写入会以密文落盘。src/api按生成器输出更新,未手改。🤖 Generated with Claude Code