fix: meaningful error for malformed XML in InFile processing#1212
Merged
fix: meaningful error for malformed XML in InFile processing#1212
Conversation
Wrap _collectCompareResult() in try/catch to produce a clear warning message including the file path and revision references when XML parsing fails, instead of letting the opaque fast-xml-parser error propagate. Closes #1203
Verify that when metadataDiff.compare throws, collect() returns a warning with the file path and both revision references instead of propagating the error.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1212 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 57 57
Lines 1535 1543 +8
Branches 201 201
=========================================
+ Hits 1535 1543 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace hard-coded error string with a message key from delta.md, consistent with the pattern used by FlowHandler and ConfigValidator.
Consolidate checkSdrMetadataCoverage and syncInternalRegistry into syncInternalRegistryWithSdr, removing the intermediate JSON file step.
|
Published under $ sf plugins install sf-git-merge-driver@dev-1212 |
|
Shipped in release $ sf plugins install sfdx-git-delta@latest-rc
# Or
$ sf plugins install sfdx-git-delta@v6.32.0💡 Enjoying sfdx-git-delta? |
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.
Summary
InFileHandler._collectCompareResult()in a try/catch so that malformed XML files produce a clear warning with the file path and revision references, instead of the opaqueCannot read properties of undefined (reading 'addChild')error from fast-xml-parserMessageServicefor the warning message, following project conventionsmainbranch after postpackcheckSdrMetadataCoverageandsyncInternalRegistrytooling scripts into a singlesyncInternalRegistryWithSdrscript, removing the intermediate JSON file step and updating CI workflow + npm scripts accordinglyCloses #1203
Test plan
metadataDiff.comparethrows,collect()returns a warning with file path and both revision referencesnpm run test:unit)src/service/inFileHandler.ts