This repository was archived by the owner on Mar 18, 2024. It is now read-only.
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Reset the Sfpowerkit on a different target org or include the org name into the cache #1413
Open
Description
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:
- Connect to Org A
- Create a new field (Account.Test__c)
- Add this field to the Admin Profile
- Run the
sfp profile reconcile
for the Admin-Profile - Switch to Org B (without the Test-Field)
- Run the
sfp profile reconcile
with target Org B - 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):
- OS: MacBook M2
- Version: @dxatscale/sfpowerscripts/24.5.0 darwin-arm64 node-v20.6.1
- Salesforce CLI(sfdx cli) Version: @salesforce/cli/2.9.8 darwin-arm64 node-v20.6.1
- CI Platform: GitHub and Local
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();