Repository navigation
fix(chain): keep proxy chain members whose remarks contain a comma - #6438
Merged
Merged
Conversation
Owner
|
感谢
改成 下面,且做好数据迁移
|
Contributor
Author
|
好的,我改成 |
b84330808
force-pushed
the
fix-proxy-chain-comma-remarks
branch
from
November 13, 2026 06:34
f04c995 to
cb40cdd
Compare
Contributor
Author
|
改好了:字段换成 proxyChainProfileList: List,启动时一次性迁移旧的 proxyChainProfiles(含逗号的备注也能正确拆),旧备份还原后也会迁移,麻烦再看看~ |
Owner
|
ProxyChainProfiles.kt 删除掉吧,这是个小问题,没有必要多一个文件.
|
Add ProfileItem.proxyChainProfileList: List<String> and use it in the proxy chain editor, the v2rayN import and connect-time resolution, so a member remark is stored as one item instead of being joined with ",". proxyChainProfiles is kept and marked @deprecated. A one-time migration in SettingsManager.initApp, next to migrateHysteria2PinSHA256, splits an existing proxyChainProfiles value on "," into proxyChainProfileList and clears the old field. Fixes 2dust#6362
b84330808
force-pushed
the
fix-proxy-chain-comma-remarks
branch
from
November 13, 2026 07:51
cb40cdd to
ad9f2e2
Compare
Contributor
Author
|
已按你说的改了:删掉了 ProxyChainProfiles.kt,proxyChainProfiles 保留并标记 @deprecated,迁移只按逗号拆分正常的数据。 |
Owner
|
感谢 |
patterniha
added a commit
to patterniha/PattNG
that referenced
this pull request
Nov 13, 2026
Upstream 2dust#6438 stores the members of a proxy chain in proxyChainProfileList instead of the comma-joined proxyChainProfiles, and its one-time migration splits the old field on every comma. PattNG already kept a comma or a backslash inside a name in that field, escaped by a backslash, so upstream's split would cut such a name in two ("US\, Dallas" became "US\" and "Dallas") and break the chain. ProfileItem.moveLegacyProxyChain moves a chain into the list as PattNG wrote it (proxyChainMembersOf: names whole, nothing trimmed) and clears the old field; SettingsManager's migration uses it. ProfileItem.proxyChainMembers reads the list, or a chain still stored the old way, as after a backup of an older PattNG is restored. The context builder and the chain editor go by it, and the editor saves the list as upstream's does. The old writer proxyChainProfilesOf is gone. Both functions that touch the deprecated field carry a function-scoped suppression and the condition for their removal. Test: - CoreConfigContextBuilderTest (the old format read, moved once, read where not moved yet; hops found by whole names) and ServerProxyChainViewModelTest (the list saved and opened; a chain stored the old way opens with its names whole). Checks: - Not run: :app:compilePlaystoreDebugKotlin, :app:testPlaystoreDebugUnitTest and :app:assemblePlaystoreDebug; there is no Android SDK on this machine. The real context builder, ProfileItem and the chain, group and subscription editor view models were compiled with kotlinc 2.4.10 and their tests run: 30 of 30 and 45 of 45 pass; with upstream's comma split in the migration, or without the old-format fallback, the new tests fail. All main and test sources were compiled with the stdlib alone for PattNG before the merge, upstream and this tree: no new error but the ServerUiState copy() one that is there already, and JUnit names in the new tests. - Not run on a device: opening, saving and connecting a chain, and the migration of chains an older PattNG stored.
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.
Fixes #6362
A proxy chain stored its members as remarks joined with
,inproxyChainProfiles, so a member whose remark contains a comma was split into names that match no profile.ProfileItem.proxyChainProfileList: List<String>, used by the proxy chain editor, the v2rayN import and connect-time resolution.proxyChainProfilesis kept and marked@Deprecated.SettingsManager.initApp, next tomigrateHysteria2PinSHA256, splits an existingproxyChainProfilesvalue on,intoproxyChainProfileListand clears the old field.:app:testPlaystoreDebugUnitTestand the Kotlin compile pass on Ubuntu with JDK 21 and the releaselibv2ray.aar. Not checked on a device.