salesforce/core vs jsforce Connection customPermissions difference #3156
Labels
investigating
We're actively investigating this issue
validated
Version information for this issue has been validated
Summary
When using the jsforce connection to install a package via a tooling sobject PackageInstallRequest create command and then running an apex test in the scratch org to determine assigned custom permissions to a user that is created in the apex test customPermissions are automatically being assigned.
Versus using the salesforce/core connection to install the same package and running the same unit test no customPermissions are being automatically assigned to the user created in the test.
I'd like to understand the difference between using the two different connections and why a jsforce connection is assigning custom Permissions to users created in apex tests.
Steps To Reproduce
I've created a public repo that uses a ci build to showcase the difference between the two connections (jsforce and salesforce/core).
To see the differences either:
📲 Install Package Version to Scratch org 📭
named step. Watch the ci build and notice the one unit test fails. Reverse the commenting of code and watch the ci build run. Notice the one unit test now passes.Expected result
After installing a package into a scratch org using the jsforce connection I would expect the same behavior when running apex tests in the org if i had installed the package with the salesforce/core connection.
Actual result
Additional customPermissions are being assigned to a user created in an apex test when using the jsforce connection.
Additional information
I believe when using the
sf package install
command it is using the salesforce/core connection to run the install. What is confusing to me is that the salesforce/core connection extends the jsforce connection class 🤔Connection classes in question:
https://github.com/jsforce/jsforce/blob/main/src/connection.ts
https://github.com/forcedotcom/sfdx-core/blob/main/src/org/connection.ts
How both scripts are calling the
PackageInstallRequst
Related api docs https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_packageinstallrequest.htm
System Information
The text was updated successfully, but these errors were encountered: