-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
cody vs code: check whether user has verified email #51870
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits ae937b3 and f7a0bd0 or learn more. Open explanation
|
e5d1589
to
1282e91
Compare
@abeatrix I pulled in some of the changes in your PR, but not all of them (because my rebase -- which I did too early -- made it hard to see the changes). @abeatrix @philipp-spiess @novoselrok can you take a look whether the introspection query here makes sense? I essentially want to check whether I can query the field and if so, I query it. Otherwise I ignore it. I also changed a lot of the checks in other places to make sure that (I haven't marked as ready for review, because it's still very rough and I need to test it, but wanted to get early eyes on the approach) |
I've seen introspection for other parts of the product already but if this only affects dotcom which we fully control, can't we just roll out the server changes first? 🤔 I’m a bit confused why we need to introspect at all |
client/cody/webviews/App.tsx
Outdated
@@ -51,12 +53,13 @@ export const App: React.FunctionComponent<{ vscodeAPI: VSCodeWrapper }> = ({ vsc | |||
break | |||
} | |||
case 'config': | |||
console.log('are we here?') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now this log user in as long as the user has entered a token, even if the token in not valid
You mean, detect whether the user connects to (Why we need introspect: I want to query General update: @abeatrix I ported a lot of your changes, and the check works when logging in (it shows error message). But right now it's broken when a request fails after the user is already logged in. I think it might have to do with serialization of I'll take another look tomorrow, but I'm not sure I'll get it done before the sprint planning. If someone has capacity and wants to hop on this branch, be my guest. |
Update after pairing session with @eseliger and @philipp-spiess on this: it works as it should now and we made the code simpler than what I had before. But the state machine in That needs to be fixed. |
@sourcegraph/cody can you review? This needs a thorough review. I'll do more manual testing (and Philip is working on adding integration test) but I really want us all to understand this code. |
1ce369c
to
35e2061
Compare
35e2061
to
c64fbb8
Compare
I added a Loom to the PR description that shows how I tested this and what the cases are: https://www.loom.com/share/f95a19cd9fd0419798fc888b49245ca0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now! I think requiring a view
to be set for any case other than the initial loading is a good idea.
Since we now have the ability to connect the Cody extension to App as a server endpoint as well, I'm going to add an |
Do you need that? Wouldn't Cody-through-App go up to dotcom anyway? Anyway, yeah, if it makes sense, open a PR |
This fixes #51992 and is a follow-up to #51706 to show a nicer message in VS Code in case user hasn't confirmed their email yet.
It changes how we fetch the authentication status:
If the user requires and doesn't have a verified email, we show a different error on the Login page.
There rest of the changes are essentially there to handle config changes, handle errors that happen at runtime, and login/logout.
This needs a thorough review
Test plan