forcedotcom / salesforcedx-vscode

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

Authorization error may be encountered after first time auth'ing an org #4519

Closed gbockus-sf closed 1 month ago

gbockus-sf commented 2 years ago

Summary

In verifying the v56.3.1 release we've encountered a few cases where on the very first authorization of an org one or more extensions will not have the correct authorization information to interact with the org (deploy, run tests, build soql queries). This seems to be a race condition around how authorization information is stored and propagated across the extensions as it will occur for just one extension and which extension isn't consistent.

Steps To Reproduce:

  1. Log out of all orgs 'SFDX: Log Out from all Authorized Orgs'
  2. Authorize an org: Click Org Picker -> SFDX: Authorize An Org
  3. Log into the org in the web browser
  4. See an error in VS Code web debug console about now
  5. Verify that deploy/run test/soql building do not work due to missing auth info.

Work around:

If you encounter this issue just reload VS Code and everything will sync up correctly.

Expected result

Should be fully configured to interact with the auth'd org.

Actual result

Error messages about authorization. Failed commands:

notificationsAlerts.ts:42 ERROR: We can’t query your org. Make sure that you’re connected to this org and have permissions to view the object and fields.

Additional information

Salesforce Extension Version in VS Code: v56.3.1

OS and version: All

git2gus[bot] commented 2 years ago

This issue has been linked to a new work item: W-11970040

gbockus-sf commented 2 years ago

This has also been encountered immediately after creating a default scratch org.

AnanyaJha commented 1 year ago

@klewis-sfdc are we good to close this issue?

diyer commented 1 month ago

Closing this old issue. Please create a new one if the problem persists with our latest vscode extension version.