dxatscale / sfpowerscripts

A build system for modular development in Salesforce
https://dxatscale.io
MIT License
213 stars 96 forks source link

Reset the Sfpowerkit on a different target org or include the org name into the cache #1413

Open Schuchie opened 1 year ago

Schuchie commented 1 year ago

Describe the bug Currently the profile reconcile command does not clean all metadata existing to the connected org. This happens only if you execute the command twice and switch the org between the first run and second run.

To Reproduce Steps to reproduce the behavior:

  1. Connect to Org A
  2. Create a new field (Account.Test__c)
  3. Add this field to the Admin Profile
  4. Run the sfp profile reconcile for the Admin-Profile
  5. Switch to Org B (without the Test-Field)
  6. Run the sfp profile reconcile with target Org B
  7. Field was not cleared, because the Sfpowerkit has still the Account.Test__c-Field from Org A in the cache

Expected behavior The Sfpowerkit-Cache resets after each change of target org or adds the org alias to the cache.

Screenshots If applicable, add screenshots to help explain your problem.

Platform Details (please complete the following information):

Additional context If I add the cache reset to the command, the reconcile works correctly or delete the current cache table:

//sfpowerscripts/packages/sfpowerscripts-cli/src/commands/profile/reconcile.ts:86
Sfpowerkit.resetCache();
azlam-abdulsalam commented 1 year ago

@Schuchie can you review the PR please