forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Retrieve Source from Org doesn't consider api version specified in sfdx-config.json #5313

Open oleg-mastriukov opened 9 months ago

oleg-mastriukov commented 9 months ago

Summary

Retrieve Source from Org action uses an API version different from what's specified in the sfdx-config.json

Steps To Reproduce:

  1. In your target org have a permission set with the External Credential Principal Access added
  2. In VSCode, go to .sfdx\sfdx-config.json and specify the 59.0 version
  3. In VSCode, click on the permission set with the right button and press the 'Retrieve Source from Org' button
  4. Note that the retrieved file doesn't contain an externalCredentialPrincipalAccesses section
  5. In VSCode, go to a terminal and run the command sfdx force source retrieve -p 'path_to_the_permission_set'
  6. Note that in this case, the file contains the externalCredentialPrincipalAccesses section

Expected result

The 'Retrieve Source from Org' action uses a specified API version the same way as the retrieve command does

Actual result

The 'Retrieve Source from Org' uses a different api version (cached somewhere?)

Additional information

The issue is similar to 3151

Salesforce Extension Version in VS Code: v59.9.0

SFDX CLI Version: 2.6.7

OS and version: Windows 10 22H2

VS Code version: 1.85.1

daphne-sfdc commented 9 months ago

Hi @oleg-mastriukov,

I am able to replicate your issue on my computer. This is actually the same issue as https://github.com/forcedotcom/salesforcedx-vscode/issues/5178. I resolved this using the workaround my team found for that issue - by deleting the .sfdx and .sf folders, running Developer: Reload Window from the command palette, reauthorizing to my org, and then retrieving my Permission Set again.

Can you try this workaround and let me know if your issue is resolved? I'll bring this to my team again.

oleg-mastriukov commented 9 months ago

Hey @daphne-sfdc,

Yep, thanks for referring to #5178, it seems to be the same problem. Your advice solved my issue, currently, the Retrieve Source from Org action uses the last (v59.0) API version. Thanks for your help! By the way, I see the previous issue was closed as resolved, but was it? It still seems to be a bug in my understanding even though it's somehow cache-related.

daphne-sfdc commented 9 months ago

Hi @oleg-mastriukov, Thank you for the confirmation that the workaround works for you. My team discussed the issue and has confirmed that yes, you're right that this is a bug, so I have logged a bug in my team's backlog.

As for the original issue - I think we decided to close #5178 at that time because that was the first issue in this area that we received so we thought it was a one-off with a workaround and weren't 100% sure whether it was a bug. Thanks for pointing that out - in that case, I'll keep this one open and tag it as bug.