salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Authorization error may be encountered after first time auth'ing an org
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:
- Log out of all orgs 'SFDX: Log Out from all Authorized Orgs'
- Authorize an org: Click Org Picker -> SFDX: Authorize An Org
- Log into the org in the web browser
- See an error in VS Code web debug console about now
- 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.
- Command Palette -> Developer: Reload Window
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
- Org Picker will show the correct org
- Org will be listed in the org picker dialog if opened
- sfdx config file looks correct
- This could be related to username vs alias in core v3. The behavior is inconsistent so it's difficult to diagnose without digging in further.
Salesforce Extension Version in VS Code: v56.3.1
OS and version: All
This issue has been linked to a new work item: W-11970040
This has also been encountered immediately after creating a default scratch org.
@klewis-sfdc are we good to close this issue?