Skip to content
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

bug: extension stuck in a startup for users without email #2663

Closed
abeatrix opened this issue Jan 10, 2024 · 0 comments · Fixed by #2665
Closed

bug: extension stuck in a startup for users without email #2663

abeatrix opened this issue Jan 10, 2024 · 0 comments · Fixed by #2665
Assignees
Labels
bug Something isn't working clients/vscode

Comments

@abeatrix
Copy link
Contributor

abeatrix commented Jan 10, 2024

Version

1.0.5

Describe the bug

Reported by Noah on Slack:

A user reported Cody is stuck in startup loading screen. Tried reinstall the extension but that didn't work.

Based on the log they shared, it looks like it was caused by changes introduced in #2233, where we create auth status with primary email when a lot of our enterprise users do not have that set up.

console.ts:137 [Extension Host] TypeError: Cannot read properties of null (reading 'email')
    at AuthProvider.makeAuthStatus

Steps to reproduce

  1. Log into Cody using an enterprise soucegraph (e.g. S2) token associated with a user that doesn't have emails set up for their account.
  2. Try reloading VS Code
Screen.Recording.2024-01-10.at.7.48.40.AM.mov

Expected behavior

Primary email should not be a requirement for sourcegraph users to load the extension.

Additional context

No response

@abeatrix abeatrix added bug Something isn't working clients/vscode labels Jan 10, 2024
@abeatrix abeatrix self-assigned this Jan 10, 2024
abeatrix added a commit that referenced this issue Jan 10, 2024
CLOSE #2663 &
#2664

A bug was introduced in #2233
where we added a requirement for `primaryEmail` during auth, resulting
in uncaught error that stopped the extension from starting.

For Enterprise instances, emails are not always required to set up an
account.

This PR includes the following changes to fix the issue above:
- update authStatus and graphQL query to reflect that `primaryEmail` and
`displayName` fields are optional
- add tests for the above change
- use username instead of displayName for enterprise instances as
username is a required field
- replace replace getEnterpriseCurrentUserInfo and
getDotComCurrentUserInfo with the new getCurrentUserInfo
- update agent tests with the changes above

## Test plan

<!-- Required. See
https://sourcegraph.com/docs/dev/background-information/testing_principles.
-->

1. Log into Cody using an enterprise soucegraph (e.g. S2) token
associated with a user that doesn't have emails set up for their
account.
2. Try reloading VS Code

### Before

Unable to start Cody on reload


https://github.com/sourcegraph/cody/assets/68532117/85ad63ef-c422-45a4-b4f8-640d5e11ecf3

### After


https://www.loom.com/share/b9049f54cb0f48da87fc630c84cc736e?sid=0e1b3677-9c3e-4c28-84b5-846f95ad4a16


https://github.com/sourcegraph/cody/assets/68532117/dd2a54f9-dfdf-4ff2-b789-a032dc6b3b1d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working clients/vscode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant