修复:systemProxy 迁移冻结 FakeIP-off 切 TUN 无感携带#261
Merged
Conversation
问题:存量 systemProxy 用户在 FakeIP 开关一次性迁移时被冻结 enableFakeIp:false(systemProxy 无 TUN、FakeIP 无意义),后续切到 TUN 模式时 flag 不随模式翻转 → 无感落入 TUN+FakeIP-off:节点收真实 IP、部分严格机场拒连,sing-box 1.14 已移除 sniff_override_destination 无替代、客户端无法缓解。 修复(三态快照,只纠正迁移冻结、绝不误伤用户主动关): - 新增 dnsConfig.fakeIpTunAutoEnable 三态,ConfigManager.migrateFakeIpTunPending 升级时刻评估一次(仅 systemProxy+enableFakeIp:false+migrated 判为迁移冻结待纠正,其余一律否决) - shared/fakeip-tun-entry.applyFakeIpTunEntry 纯函数在切模式入口(proxy-control-card + tray-actions 两处 proxyModeType 用户切换点)消费:首次进 TUN 回 true + toast/桌面通知 - 用户任何一次手动改 FakeIP 同写 fakeIpTunAutoEnable:false(意图即撤销,不误伤 TUN 下主动关) - backup 导入后重 loadConfig 让迁移即时生效;ProxyManager norm 排除迁移元数据防无谓重启 - 单测 E/F/G(评估 / 纯函数 / 端到端生命周期)
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.
问题
存量 systemProxy 用户在 FakeIP 开关一次性迁移时被冻结
enableFakeIp:false(systemProxy 无 TUN、FakeIP 无意义)。后续切换到 TUN 模式时,flag 不随模式翻转(迁移一次性 +usesFakeIp纯看开关)→ 无感落入 TUN + FakeIP-off:节点收真实 IP、部分严格机场拒连,且 sing-box 1.14 已移除sniff_override_destination、客户端无法缓解。修复
核心难点:「迁移冻结的 false」与「用户在 TUN 下主动关的 false」落盘后字节相同、无法 post-hoc 区分。方案用三态快照 + 意图即撤销把误伤压到理论最小:
dnsConfig.fakeIpTunAutoEnable(三态);ConfigManager.migrateFakeIpTunPending在升级时刻评估一次——仅systemProxy + enableFakeIp:false + migrated判为迁移冻结(待纠正),其余一律否决(含 tun/manual+false 的用户主动态、新装)。shared/fakeip-tun-entry.applyFakeIpTunEntry纯函数在切模式入口(proxy-control-card+tray-actions,proxyModeType 仅有的两个用户切换点)消费:首次进 TUN 把冻结的 FakeIP 回 true + toast / 桌面通知。fakeIpTunAutoEnable:false(意图即撤销)→ 绝不误伤 TUN 下主动关 FakeIP 的用户。loadConfig让迁移对导入配置即时生效;ProxyManagernorm 排除迁移元数据防无谓重启。验证