Skip to content

Commit 841c40c

Browse files
committed
fix: update manifest.remove() to use componentName instead of componentType
1 parent b353954 commit 841c40c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/salesforce/src/deploymentPackage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class SalesforcePackage {
226226
* @param entry - The component to remove.
227227
*/
228228
public remove(entry: SalesforcePackageComponent) {
229-
this.manifest.remove(entry.componentType, entry.componentType);
229+
this.manifest.remove(entry.componentType, entry.componentName);
230230

231231
// Clean up source file mappings
232232
const packageKey = `${entry.componentType}.${entry.componentName}`.toLowerCase();

packages/salesforce/src/retrieveDeltaStrategy.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RetrieveDeltaStrategy {
2727
'binary': this.isBinaryEqual.bind(this),
2828
'default': this.isStringEqual.bind(this),
2929
// Custom comparers
30-
'InstalledPackage': (a, b) => this.isPackageNewer(a, b),
30+
'InstalledPackage': (a, b) => !this.isPackageNewer(a, b),
3131
}
3232

3333
constructor(
@@ -167,20 +167,19 @@ export class RetrieveDeltaStrategy {
167167
const parsedB = XML.parse(b, { arrayMode: options?.arrayMode, ignoreAttributes: true });
168168

169169
// Compare parsed XML
170-
const diff = deepCompare(parsedA, parsedB, {
171-
primitiveCompare: this.primitiveCompare,
172-
ignoreArrayOrder: !options?.strictOrder,
173-
ignoreExtraProperties: !!options?.ignoreExtra
174-
});
175-
return !!diff;
170+
return deepCompare(parsedA, parsedB, {
171+
primitiveCompare: this.primitiveCompare,
172+
ignoreArrayOrder: !options?.strictOrder,
173+
ignoreExtraProperties: !!options?.ignoreExtra
174+
});
176175
}
177176

178177
private isPackageNewer(a: Buffer | string, b: Buffer | string): boolean {
179178
const localMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true });
180179
const orgMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true });
181180

182-
const localVersion = parseFloat(localMeta.versionNumber);
183-
const orgVersion = parseFloat(orgMeta.versionNumber);
181+
const localVersion = parseFloat(localMeta.InstalledPackage?.versionNumber);
182+
const orgVersion = parseFloat(orgMeta.InstalledPackage?.versionNumber);
184183
if (isNaN(localVersion) || isNaN(orgVersion)) {
185184
return true;
186185
}

0 commit comments

Comments
 (0)