-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adding connection state to database side panel #226
Conversation
|
packages/vscode-extension/src/webviews/controllers/connectionPanelController.ts
Outdated
Show resolved
Hide resolved
7960884
to
19cfceb
Compare
550b84c
to
4a1fa54
Compare
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.
Changes in here support;
- prefilled inputs when adding a new connection
- refilling all possible inputs when editing a connection
- highlighting server invalidated fields on save
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.
Nice work! I think the approach makes sense and have gone through the code, but not yet tested the vsix yet
) { | ||
_context = context; | ||
_languageClient = languageClient; | ||
_databaseConnectionManager = new SchemaPollerConnectionManager(); |
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.
@ncordon the vscode extension already has it's own driver instance here, you can create another one if you prefer, but I think it'd be nice to reuse this one as it's already got all the lifecycle (create, update, verify connectivity) set up
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.
Well this wasn't my point. This in fact means we already have two drivers at the moment: one on the VSCode side and one embedded in the language server
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.
LGTM for the moment, but I need to better understand the flow of the application
) { | ||
_context = context; | ||
_languageClient = languageClient; | ||
_databaseConnectionManager = new SchemaPollerConnectionManager(); |
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.
Well this wasn't my point. This in fact means we already have two drivers at the moment: one on the VSCode side and one embedded in the language server
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.
It looks good to me.
Only one last thing: the package.json
seems to have a lot of weird changes.
I'd recommend doing this to regenerate it again:
nvm use
npm i
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.
I've been trying out some interactions again and it all seems to be working correctly
This PR introduces connection state to the database side panel.
At the moment, the side panel is fairly basic and will simply show a state for
connected
, even if under the hood the connection has failed.In this change, the side panel becomes much smarter and hooks into newly emitting events from the underlying driver/database connection. The side panel will update itself when a database connection drops, when it reconnects and when it gives up trying to connect to the database.
Also introduced is instant connection status feedback when adding/editing/connecting to/toggling a Connection.. whether this is bad auth, a non existent database or an unreachable server.
In the side panel, when you connect to a connection you are first presented with a "Connecting" state.. the label next to the connection will briefly read
connecting...
until the connection promise resolves, at which point we switch the label toconnected
and show a success info message.For connections that error (and are retriable), we will show a
reconnecting...
label and an accompanying warning message.For connections that fail, we will remove the connecting state entirely and display an error message.