Skip to content

Query Profiler - Fix on Launching from a standard on prem - with default DB#21610

Merged
allancascante merged 1 commit intomainfrom
dev/allancascante/query_profiler_on_prem_default_db
Mar 13, 2026
Merged

Query Profiler - Fix on Launching from a standard on prem - with default DB#21610
allancascante merged 1 commit intomainfrom
dev/allancascante/query_profiler_on_prem_default_db

Conversation

@allancascante
Copy link
Copy Markdown
Contributor

Description

When launching a query profiler from a standard on prem db having a default database in the connection profile the query profiler fails to update the ui with the state and events for the profiler session created in the back end.

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Copy link
Copy Markdown
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

Fixes Query Profiler launch for on-prem connections that have a default (user) database set in the connection profile, which previously caused the profiler UI to not reflect the created session’s state/events.

Changes:

  • Clear connectionProfile.database for on-prem profiler launches (while preserving it as an initial UI database filter when applicable).
  • Add unit tests validating the on-prem behavior for user vs system databases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
extensions/mssql/src/profiler/profilerController.ts Clears database on on-prem launches to ensure server-scoped XEvent session discovery works correctly.
extensions/mssql/test/unit/profiler/profilerController.test.ts Adds regression tests confirming database clearing behavior for on-prem profiles with default DBs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6424 KB 6411 KB ⚪ -13 KB ( 0% )
sql-database-projects VSIX 7061 KB 7061 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.73%. Comparing base (6ee5847) to head (b88a84d).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #21610   +/-   ##
=======================================
  Coverage   72.73%   72.73%           
=======================================
  Files         331      331           
  Lines       98598    98613   +15     
  Branches     5481     5483    +2     
=======================================
+ Hits        71715    71730   +15     
  Misses      26883    26883           
Files with missing lines Coverage Δ
...xtensions/mssql/src/profiler/profilerController.ts 50.00% <100.00%> (+0.61%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if (!databaseScopeFilter) {
databaseScopeFilter = profileToUse.database;
}
profileToUse = { ...profileToUse, database: "" };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When database is "", it sets the profile to use the default DB?

@lewis-sanchez
Copy link
Copy Markdown
Contributor

Create an issue to track this, if you're going to port.

@allancascante allancascante merged commit c1246f3 into main Mar 13, 2026
7 checks passed
@allancascante allancascante deleted the dev/allancascante/query_profiler_on_prem_default_db branch March 13, 2026 18:37
allancascante added a commit that referenced this pull request Mar 13, 2026
…n the connection profile (#21610)

Co-authored-by: Allan Cascante <acascante@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants