Skip to content

Conversation

@tnaum-ms
Copy link
Collaborator

This pull request trims user input when connection string is provided + it adds validation to ensure that the connection string is not empty when creating a new connection. If the user attempts to submit an empty connection string, a localized error message is shown.

Validation improvements:

  • Added a check in PromptConnectionStringStep.ts to trim and validate that the connection string is not empty, returning a localized error if it is.
  • Added the localized string "Connection string cannot be empty." to bundle.l10n.json for use in error messaging.

Copilot AI review requested due to automatic review settings January 27, 2026 12:34
@tnaum-ms tnaum-ms requested a review from a team as a code owner January 27, 2026 12:34
@tnaum-ms tnaum-ms added this to the 0.7.0 "January 2025" milestone Jan 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds validation to ensure that connection strings provided by users are trimmed and not empty when creating a new MongoDB connection. The change prevents users from submitting whitespace-only or empty connection strings.

Changes:

  • Added empty string validation in the async validator to match the established pattern used throughout the codebase
  • Trimmed user input before validation to handle leading/trailing whitespace
  • Added a localized error message for empty connection strings

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/commands/newConnection/PromptConnectionStringStep.ts Added trimming and empty string validation to the validateConnectionString method to ensure valid connection string input
l10n/bundle.l10n.json Added localized error message "Connection string cannot be empty." for the new validation

@tnaum-ms tnaum-ms merged commit 72c3bbd into next Jan 29, 2026
8 checks passed
@tnaum-ms tnaum-ms deleted the dev/tnaum/trim-connection-string branch January 29, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants