Skip to content

Keep existing profiles when subscription import fails - #10429

Open
dajiaohuang wants to merge 1 commit into
2dust:masterfrom
dajiaohuang:fix/preserve-subscriptions-on-failed-import-20261020
Open

dajiaohuang wants to merge 1 commit into
2dust:masterfrom
dajiaohuang:fix/preserve-subscriptions-on-failed-import-20261020

Conversation

@dajiaohuang

Copy link
Copy Markdown

Related to #10370. This addresses the profile-loss portion of that report; it does not diagnose or fix the underlying parser exception.

AddBatchServers previously removed existing subscription profiles before attempting to parse the replacement. When the import failed or threw before accepting any new profiles, that ordering had already deleted the old rows. Defer removal until at least one new profile is imported, then remove only the snapshotted subscription-owned rows.

Regression coverage verifies that a failed import preserves the prior profile and a successful full-config import still replaces the prior subscription entry.

Validation:

  • dotnet test --project ./v2rayN/ServiceLib.Tests -c Release --results-directory ./TestResults -- --report-trx — 137 passed.
  • git diff --check — clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant