From 4850446a640d776a6f502f87c79ad5c7f62dee93 Mon Sep 17 00:00:00 2001 From: Peter van Gulik Date: Thu, 15 Aug 2024 11:53:58 +0200 Subject: [PATCH] fix: order of arguments in isPackageNewer function --- packages/salesforce/src/retrieveDeltaStrategy.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/salesforce/src/retrieveDeltaStrategy.ts b/packages/salesforce/src/retrieveDeltaStrategy.ts index 6df0c298..ef50f603 100644 --- a/packages/salesforce/src/retrieveDeltaStrategy.ts +++ b/packages/salesforce/src/retrieveDeltaStrategy.ts @@ -202,9 +202,9 @@ export class RetrieveDeltaStrategy { }); } - private isPackageNewer(current: Buffer | string, target: Buffer | string): boolean { - const localMeta = XML.parse(target, { arrayMode: false, ignoreAttributes: true }); - const orgMeta = XML.parse(current, { arrayMode: false, ignoreAttributes: true }); + private isPackageNewer(a: Buffer | string, b: Buffer | string): boolean { + const orgMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true }); + const localMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true }); const localVersion = parseFloat(localMeta.InstalledPackage?.versionNumber); const orgVersion = parseFloat(orgMeta.InstalledPackage?.versionNumber); @@ -227,8 +227,8 @@ export class RetrieveDeltaStrategy { private isMetaXmlEqual(a: Buffer | string, b: Buffer | string): boolean { // Note: this function does not yet properly deal with changes in the order of XML elements in an array // Parse XML and filter out attributes as they are not important for comparison of metadata - const localMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true }); - const orgMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true }); + const orgMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true }); + const localMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true }); if (orgMeta.packageVersions && !localMeta.packageVersions) { // If the org data has package versions details but the local data does not, copy the package versions details;