Migrate profile files from XML to JSON format#3289
Conversation
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
…SON deserialization Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
… improve readability Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
… fix compatibility Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
|
@copilot there is an issue when loading a file and it will be removed/re-added (with a different profilefileinfo). The collection will change and the UI is wrongly updated. Can you check the existing logic that is used when a profile is removed / readded. This is part with the issue: And this might be a possible fix that is already working in some other part of this class (check and validate if this is true) |
…UI issues Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Fixed in commit 37869e5. The ProfileFiles collection update order now follows the existing pattern used in RenameProfileFile, EnableEncryption, ChangeMasterPassword, and DisableEncryption methods:
This prevents the UI from being incorrectly updated during migration. |
|
@copilot Revert the last commit and use the existing logic, because this implements a ui change already... |
|
Close because of #3299 |
Changes proposed in this pull request
GetJsonProfilePath()for path construction andIsXmlContent()for efficient format detection (checks first 200 bytes)Related issue(s)
Copilot generated summary
Provide a Copilot generated summary of the changes in this pull request.
Copilot summary
This PR migrates NETworkManager profile files from XML to JSON format. The implementation:
Core Changes:
.xmlto.jsonSystem.Text.Jsonwith indented formatting, case-insensitive deserialization, and enum converters[Obsolete]for backward compatibility during migrationMigration Logic:
.xmlextension → deserialize XML → serialize JSON → delete old fileKey Methods:
Collection Update Pattern:
The ProfileFiles collection update order follows the existing pattern used throughout the class (RenameProfileFile, EnableEncryption, etc.):
This prevents UI update issues during migration.
Safety & Quality:
groupSerializable.Profiles ?? new List<ProfileInfoSerializable>()To-Do
Contributing
By submitting this pull request, I confirm the following:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.