-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profile reconciliation is removing components from the profile that are in the org #162
Comments
I believe I am also experiencing this issue. For me it was a tab visibility setting for reports and dashboards. Set in file, but not reflecting in the org. This is on sfp-rc:39.5.1-13409618031 too. |
We also had a discussion about this in slack, but I'll share some detail here for others. In our instance, the reason is related to how the cache is being built and accessed. I'm honestly trying to figure out how this worked from the beginning for us, but haven't tracked that down just yet. Here is the context for our situation. The cache used in
We have a profile in package1 that has a reference to CustomApplication, we'll call it App1. When package1 is installed and profile reconciliation runs against the destination org, the cache for CustomApplication is populated with all of the references from the profile that are in the destination org. Because none of the CustomApplications are deployed yet the cache is built from all of the Standard Applications that are referenced in the profile and all the custom application references are removed. After, the first deployment, the profiles are restored to their previous state and reconciled again. However, since the cache key has already been established, the org is not checked for the new components, and so they are removed again and no permissions updates are applied to that CustomApplication. Where this can cause deployment failures is if you are attempting to set your default application as one of these custom applications and you are explicitly setting your standard applications as not visible. Salesforce will throw a deployment error at that point, which is what happened in our case. Where will this cause problems?
How can you avoid the problem until a fix is released?
|
Describe the bug
As of Fri, 28 Feb 2025 17:13:44 GMT, our profile reconciliation process has started to fail. Our profiles that have custom applications set as the App default are having the
applicationVisibilities
removed for the custom apps despite the applications being deployed to the org. This is resulting in the error messageYou can't remove the only default app from the profile.
NOTE: This only happens if the
sfpowerkit-cache.db
exists prior to the custom application being deployed. If the cache is reset and then the process is repeated theapplicationVisibilities
tag is not removed. It also appears to be related to applicationVisibilities, because I tried the same process with<fieldPermissions>
and those did not get removed.UPDATE: It is not isolated to just one metadata type. I was able to reproduce the issue with other metadata types. More details in comment below.
To Reproduce
sfpowerkit-cache.db
by running a reconciliation before the application is deployedsf org list metadata --metdata-type CustomApplication
<applicationVisibilities>
for the custom application to have<default>true</default>
and<visible>true</visible>
default
andvisible
tags tofalse
sfp profile reconcile -n "NameOfProfile" -o {orgalias}
Expected behavior
applicationVisibilities
section for the Custom Application that exists in the org should remain in the profileActual behavior
applicationVisibilities
section for the Custom Application that exists in the org is removed from the profile.Screenshots
If applicable, add screenshots to help explain your problem.
Platform Details (please complete the following information):
Additional context
There is a deprecation warning in the terminal window that seems to have started around the same time that this stopped working. I'm including that here
The text was updated successfully, but these errors were encountered: