Skip to content

Commit

Permalink
Fix misleading error message when user token is unavailable (#225)
Browse files Browse the repository at this point in the history
It fixes #224 
## Test plan
* Add account on one version of IJ
* Open another version of IJ with cody installed
* Deny access to keychain
* Prompt about adding missing token should be displayed


https://github.com/sourcegraph/jetbrains/assets/9321940/ff5f7923-875d-40a1-bcdf-81f38c0f8bd7


<!-- All pull requests REQUIRE a test plan:
https://sourcegraph.com/docs/dev/background-information/testing_principles

Why does it matter?

These test plans are there to demonstrate that are following industry
standards which are important or critical for our customers.
They might be read by customers or an auditor. There are meant be simple
and easy to read. Simply explain what you did to ensure
your changes are correct!

Here are a non exhaustive list of test plan examples to help you:

- Making changes on a given feature or component:
- "Covered by existing tests" or "CI" for the shortest possible plan if
there is zero ambiguity
  - "Added new tests"
- "Manually tested" (if non trivial, share some output, logs, or
screenshot)
- Updating docs:
  - "previewed locally"
  - share a screenshot if you want to be thorough
- Updating deps, that would typically fail immediately in CI if
incorrect
  - "CI"
  - "locally tested"
-->
  • Loading branch information
Sa1to authored Dec 22, 2023
1 parent 1b12a98 commit 014311d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ class CodyToolWindowContent(private val project: Project) : UpdatableChat {
agentUserId = getUserId(server)
}
if (jetbrainsUserId != agentUserId) {
logger.error("User id in JetBrains is different from agent")
if (agentUserId != null) {
logger.error("User id in JetBrains is different from agent")
return
}
return
}

Expand Down

0 comments on commit 014311d

Please sign in to comment.