Skip to content

fix(vscode): getConfiguration handles object input for Service Provider connections with MSI#8820

Open
samikay101 wants to merge 1 commit intomainfrom
skarakra/SPdropDownMenu
Open

fix(vscode): getConfiguration handles object input for Service Provider connections with MSI#8820
samikay101 wants to merge 1 commit intomainfrom
skarakra/SPdropDownMenu

Conversation

@samikay101
Copy link
Contributor

Commit Type

  • fix - Bug fix

Risk Level

  • Low - Minor changes, limited scope

Summary

When using Service Provider connections with Managed Identity authentication in VS Code local development, dynamic dropdowns (e.g., Queue name for Service Bus) fail with a network error.

Root Cause

The getConfiguration function was being called twice in the call chain:

  1. First call: connectionId = string (e.g., "/serviceProviders/serviceBus/connections/serviceBus-6") ✅
  2. Second call: connectionId = the configuration object returned from the first call ❌

On the second call, the function tried to parse an object as a string, which caused extractConnectionName() to fail, resulting in an empty configuration being sent to the backend.

Fix

Added a type check at the start of getConfiguration to detect when an object is passed instead of a string. If an object is passed, return it directly since it's already a valid configuration.

Impact of Change

Area Impact
Users Service Provider connections with Managed Identity now work correctly in VS Code local development. Dynamic dropdowns populate as expected.
Developers No API changes. This is a defensive workaround that makes getConfiguration resilient to incorrect input types.
System No performance or architectural impact. The type check adds negligible overhead.

Test Plan

  • Manual testing completed
  • Tested in: VS Code local development with Service Bus MSI connection

Manual Test Steps

  1. Create Logic App Standard project in VS Code
  2. Add Service Bus connection with Managed Identity authentication
  3. Add "Send message" action
  4. Click Queue name dropdown
  5. Expected: Dropdown populates with queues from Service Bus namespace
  6. Actual (before fix): Network error, empty response
  7. Actual (after fix): Dropdown works correctly ✅

Notes

This is a workaround fix. The root cause is upstream in the call chain where something calls getConfiguration twice, passing the result of the first call as input to the second. A future cleanup could investigate and fix the upstream caller.

Copilot AI review requested due to automatic review settings February 17, 2026 23:05
@samikay101 samikay101 added the risk:low Low risk change with minimal impact label Feb 17, 2026
@github-actions
Copy link

github-actions bot commented Feb 17, 2026

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): getConfiguration handles object input for Service Provider connections with MSI
  • Issue: None — title is clear, follows conventional commit style, and explains the area and intent.
  • Recommendation: (Optional) This is good as-is.

Commit Type

  • Properly selected (fix).
  • Only one box selected which is correct.

Risk Level

  • The PR body marks Low and the PR has the label risk:low. These match.

What & Why

  • Current: The PR includes a concise Summary, Root Cause, and Fix description.
  • Issue: None — the explanation is clear and explains why the defensive check is necessary.
  • Recommendation: (Optional) You could add a one-line reference to the specific function/file changed (servicesHelper.ts) in the What & Why to make the diff traceability immediate.

Impact of Change

  • Impact is described for Users, Developers, and System.
  • Recommendation: Keep the note that this is a workaround and (if available) link to a follow-up issue or TODO to fix the upstream caller so reviewers know there is a tracked follow-up.
    • Users: Dynamic dropdowns for MSI-based Service Provider connections in VS Code local development now populate correctly.
    • Developers: Defensive change only — no API changes.
    • System: Negligible overhead.

⚠️ Test Plan

  • The PR documents manual testing steps and marks Manual testing completed.
  • Assessment: Acceptable for this small change, and you provided clear reproduction and validation steps.
  • Recommendation: Add a small unit test that calls getConfiguration with an object input to lock this behavior in and prevent regressions. Even a single unit test asserting that an object input is returned unchanged would be valuable.

⚠️ Contributors

  • No contributors listed in the PR body.
  • Recommendation: If anyone else (PM/design/peer) contributed to the investigation or review, consider calling them out here. If none, it's fine to leave blank.

Screenshots/Videos

  • Visuals are not required for this change.
  • Assessment: OK to leave blank.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level Matches label risk:low
What & Why Consider referencing the changed file directly
Impact of Change Add a follow-up issue link for upstream fix
Test Plan ⚠️ Add a unit test for object input
Contributors ⚠️ Add credits if applicable
Screenshots/Videos N/A

Final message
This PR passes the PR-title-and-body checks. The advised risk level based on the small, localized code change is risk:low, which matches the label and PR body. Please consider adding a minimal unit test for the object-input case and optionally add a follow-up issue link to fix the upstream caller (you already note this is a workaround — linking/tracking it helps reviewers). Also consider adding a Contributors line if others helped.

Thank you — this is a clear, small, well-documented fix. Happy to re-check after you add the suggested unit test or follow-up issue link if you want.


Last updated: Tue, 17 Feb 2026 23:06:32 GMT

@github-actions
Copy link

📊 Coverage Check

The following changed files need attention:

⚠️ apps/vs-code-react/src/app/designer/servicesHelper.ts - 40% covered (needs improvement)

Please add tests for the uncovered files before merging.

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 PR adds a defensive workaround to the getConfiguration function to handle cases where it's called with a configuration object instead of a connection ID string. This issue manifests when using Service Provider connections with Managed Identity authentication in VS Code local development, causing dynamic dropdowns (like Service Bus queue names) to fail with network errors.

Changes:

  • Added type check in getConfiguration to detect and return configuration objects passed as input
  • Added explanatory comment documenting this as a workaround

Comment on lines +183 to +189
// WORKAROUND: If connectionId is already a configuration object (not a string),
// it means something is calling getConfiguration with the result of a previous call.
// In this case, just return the object as-is.
const connectionIdAsAny = connectionId as any;
if (typeof connectionIdAsAny === 'object' && connectionIdAsAny !== null) {
return connectionIdAsAny as Record<string, any>;
}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This workaround is masking the real bug in the VS Code connector service. The root cause is in apps/vs-code-react/src/app/designer/services/connector.ts lines 31 and 50, where getListDynamicValues() and getDynamicSchema() are passing the configuration object to _listDynamicValues() and _getDynamicSchema(), but these parent class methods expect connectionId (string) and configuration (object) as separate parameters respectively.

The proper fix would be to update connector.ts line 31 from:
return this._listDynamicValues(connectorId, operationId, parameters, dynamicState, configuration);
to:
return this._listDynamicValues(connectorId, operationId, parameters, dynamicState, connectionId);

And ensure line 50 passes the correct parameters to _getDynamicSchema() as well. This defensive check can remain as a safety measure, but the upstream bug should be fixed to prevent the double-calling pattern.

Copilot uses AI. Check for mistakes.
Comment on lines +186 to +188
const connectionIdAsAny = connectionId as any;
if (typeof connectionIdAsAny === 'object' && connectionIdAsAny !== null) {
return connectionIdAsAny as Record<string, any>;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The variable name connectionIdAsAny is misleading because it's not actually a connection ID - it's a parameter that might be either a connection ID (string) or a configuration object. A more accurate name would be connectionIdParam or connectionIdOrConfig to reflect that it could be either type.

Suggested change
const connectionIdAsAny = connectionId as any;
if (typeof connectionIdAsAny === 'object' && connectionIdAsAny !== null) {
return connectionIdAsAny as Record<string, any>;
const connectionIdOrConfig = connectionId as any;
if (typeof connectionIdOrConfig === 'object' && connectionIdOrConfig !== null) {
return connectionIdOrConfig as Record<string, any>;

Copilot uses AI. Check for mistakes.
Comment on lines 180 to +188
getConfiguration: async (connectionId: string, manifest: OperationManifest | undefined): Promise<any> => {
try {
const configuration: Record<string, any> = {};
// WORKAROUND: If connectionId is already a configuration object (not a string),
// it means something is calling getConfiguration with the result of a previous call.
// In this case, just return the object as-is.
const connectionIdAsAny = connectionId as any;
if (typeof connectionIdAsAny === 'object' && connectionIdAsAny !== null) {
return connectionIdAsAny as Record<string, any>;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Using as any to cast the parameter bypasses TypeScript's type checking. Since the function signature declares connectionId: string, this type mismatch should ideally be caught at compile time. Consider changing the function signature to connectionId: string | Record<string, any> to make the defensive check explicit in the type system, or use a more type-safe approach with a type guard.

Suggested change
getConfiguration: async (connectionId: string, manifest: OperationManifest | undefined): Promise<any> => {
try {
const configuration: Record<string, any> = {};
// WORKAROUND: If connectionId is already a configuration object (not a string),
// it means something is calling getConfiguration with the result of a previous call.
// In this case, just return the object as-is.
const connectionIdAsAny = connectionId as any;
if (typeof connectionIdAsAny === 'object' && connectionIdAsAny !== null) {
return connectionIdAsAny as Record<string, any>;
getConfiguration: async (
connectionId: string | Record<string, any>,
manifest: OperationManifest | undefined
): Promise<any> => {
try {
const configuration: Record<string, any> = {};
// WORKAROUND: If connectionId is already a configuration object (not a string),
// it means something is calling getConfiguration with the result of a previous call.
// In this case, just return the object as-is.
if (typeof connectionId === 'object' && connectionId !== null) {
return connectionId;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants