Improve experience when adding server - Save tests the connection#291
Conversation
erikdarlingdata
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The core idea — testing the connection on Save — is good. A few things need to be addressed before this can merge:
Bug: Dashboard XAML missing RowDefinition
StatusText is placed at Grid.Row="2" and the buttons moved to Grid.Row="3", but the Grid only defines 3 rows (0-2). WPF won't crash but elements will overlap. Add a 4th RowDefinition Height="Auto" for the new StatusText row.
IsEnabled on ServerConnection — add the UI or remove the property
The IsEnabled property is added to the Dashboard model but there's no checkbox in the XAML to set it. It's dead code that will serialize to JSON but never be consumed. Either add the "Enable data collection" checkbox to the Dashboard dialog (like Lite has) or remove this property from the PR.
Dashboard should support Entra MFA authentication
If the goal is parity, Dashboard is still missing Entra MFA as an auth option. Dashboard can connect to Azure Managed Instance, which supports Entra MFA. Lite already has this — Dashboard should too.
Failure feedback should use MessageBox, not inline StatusText
Failures should be loud and obvious (MessageBox), not rely on inline text that the user might miss. The Dashboard side does this correctly (MessageBox on failure), but the Lite side was changed to use inline StatusText for save failures — keep it as a MessageBox.
Keep SELECT @@VERSION in the connection test
The PR removes the SELECT @@VERSION test query from Lite's test handler. That query confirmed the connection was fully functional and showed the server version — useful feedback. Please keep it.
Connection string should be built the same way
Dashboard uses DatabaseService.BuildConnectionString() while Lite builds a SqlConnectionStringBuilder directly. These should use the same approach for consistency and to avoid drift.
|
@erikdarlingdata, for "Dashboard should support Entra MFA authentication". Should we test the connection against the
If you agree with it, that is the current state of this PR. |
|
@ClaudioESSilva yes please, it should not ever look at any other database. |
|
Then, it's already there! 🙌🏼 |
erikdarlingdata
left a comment
There was a problem hiding this comment.
Solid contribution — all first-round review items addressed. Code quality is good and backward compatibility is handled correctly.
Highlights:
- Clean
UseWindowsAuth→AuthenticationTypemigration shim for oldservers.jsonfiles - MFA cancellation handling prevents nagging popup loops during background checks
- Good refactoring:
BuildConnectionBuilder(),ValidateInputs(),RunConnectionTestAsync()consolidate duplicated logic - Smart Save behavior distinction: Dashboard offers "save anyway?" on failure, Lite blocks save when collection is enabled (correct since Lite collects immediately)
Minor notes (not blockers):
ConnectTimeoutis 10s in dialog test vs 15s at runtime inGetConnectionString()— fine but worth knowing- MFA connection builder logic exists in both
AddServerDialog.BuildConnectionBuilder()andServerConnection.GetConnectionString()— could drift over time, but acceptable for now
Ready to merge. Thanks @ClaudioESSilva!







What does this PR do?
Fixes #29
Which component(s) does this affect?
How was this tested?
Tested on the Dashboard version by using the wrong password and hit "Save" button:

For the Lite version, this is how it will show

Now, on both versions, when testing the connection, the "Save" button also becomes disabled.
Checklist
dotnet build -c Debug)Important
It has some warnings
CA1873, but that isn't related to anything I've changed.For reference, I forked and updated from a recent
devbranch