keiko233 说明 Clash Nyanpasu 的 IPv6 同步迁移与 HTTP 接口不兼容变更
在 Clash Nyanpasu #6609 的讨论中,keiko233 说明,此次仅让 ipv6 可由配置管理,allow-lan 仍保留在 ClashAccessPatch 后,新装默认值不变。他将便携同步修订升至 2,读取修订 1 文档时把布尔 ipv6 转为保留同值的 Managed;迁移测试样本也改为旧版实际写入的布尔值,选择器标签简化为“IPv6”。他指出,HTTP 暴露的 patch_runtime_overrides 中,ipv6 现改用 {kind, value} 结构,拒绝裸布尔值,接受这一不兼容变更而不加兼容层。对于强制值与配置不一致时显示提示的建议,他希望另开 PR,先用简短规格确定设计。
作者原文@keiko233Thanks for narrowing it down so quickly. The scope looks right to me now: only
ipv6becomes manageable,allow-lanstays behindClashAccessPatch, and the fresh-install defaults are unchanged.I pushed three small commits on top of yours:
- fix(sync):
overrides.ipv6is a portable sync field, so its shape change needed a portable revision bump. Without it, devices on different versions broke each other's sync. The portable revision is now 2, and a revision 1 document is upgraded on read (a booleanipv6becomesManaged(<same value>)), so mixed-version vaults still merge.- test(migration): the 2.0 fixture is built from today's defaults, so its
ipv6was already managed and the runner tests never actually exercisedclash_config/manageable_ipv6. It now stores the boolean 2.0 wrote.- fix(settings): the selector label is now just "IPv6", since "Enable IPv6: Follow profile" read oddly.
One note for the description:
patch_runtime_overridesis HTTP-exposed, soipv6now uses the{kind, value}shape on the wire and a bare boolean is rejected. We're accepting that as a breaking change rather than adding a compatibility layer.On the defaults: I'd like to keep the current narrowed scope for this PR. Option 2 (showing a hint in settings and the config inspector when a forced value differs from the profile's) sounds feasible and genuinely useful. Since it touches the settings UI, the inspector and the runtime pipeline, let's do it in a separate PR, starting with a short spec under
docs/spec/to settle the design first. You're very welcome to join: happy to draft the spec together, or review yours if you'd like to take the lead.