Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion libs/designer-ui/src/lib/staticResult/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ export const StaticResultContainer = ({
additionalProperties: additionalPropertiesSchema,
required,
} = useMemo(() => {
return parseStaticResultSchema(staticResultSchema);
const parsed = parseStaticResultSchema(staticResultSchema);
console.log('[DEBUG StaticResult] StaticResultContainer - parseStaticResultSchema', {
inputSchema: JSON.stringify(staticResultSchema, null, 2),
parsedPropertiesKeys: parsed.properties ? Object.keys(parsed.properties) : 'none',
parsedRequired: parsed.required,
outputsInParsed: parsed.properties?.outputs ? JSON.stringify(parsed.properties.outputs, null, 2) : 'none',
});
return parsed;
Comment on lines +175 to +182
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

console.log inside useMemo runs during render and is a side effect; in React StrictMode it may run twice and it makes render less pure. If you keep this diagnostic, move it to a useEffect that depends on staticResultSchema/parsed output (and gate behind a debug flag) to avoid render-path side effects.

Copilot uses AI. Check for mistakes.
}, [staticResultSchema]);

return (
Expand Down
14 changes: 13 additions & 1 deletion libs/designer-ui/src/lib/staticResult/staticResultProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StaticResultProperty } from './staticResultProperty';
import { formatShownProperties, getOptions, initializeShownProperties } from './util';
import type { OpenAPIV2 } from '@microsoft/logic-apps-shared';
import type { Dispatch, SetStateAction } from 'react';
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { useIntl } from 'react-intl';

interface StaticResultPropertiesProps {
Expand All @@ -28,6 +28,18 @@ export const StaticResultProperties = ({
initializeShownProperties(required, propertiesSchema, propertyValues)
);

// Debug logging for StaticResultProperties
useEffect(() => {
console.log('[DEBUG StaticResult] StaticResultProperties rendered', {
isRoot,
propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : 'none',
required,
shownProperties,
propertyValues,
dropdownOptions: getOptions(propertiesSchema, required),
Comment on lines +31 to +39
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

This component logs full dropdown options and propertyValues every render, which can be large and may contain user-provided values. Please gate behind a debug flag (dev-only/localStorage toggle) and consider logging only counts/keys instead of full objects to reduce noise and data exposure risk.

Suggested change
// Debug logging for StaticResultProperties
useEffect(() => {
console.log('[DEBUG StaticResult] StaticResultProperties rendered', {
isRoot,
propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : 'none',
required,
shownProperties,
propertyValues,
dropdownOptions: getOptions(propertiesSchema, required),
// Debug logging for StaticResultProperties (gated behind localStorage flag)
useEffect(() => {
if (typeof window === 'undefined') {
return;
}
const debugFlag = window.localStorage?.getItem('mslaDebugStaticResultProperties');
if (debugFlag !== 'true') {
return;
}
const dropdownOptions = getOptions(propertiesSchema, required) ?? [];
const propertyKeys = propertyValues ? Object.keys(propertyValues) : [];
console.log('[DEBUG StaticResult] StaticResultProperties rendered', {
isRoot,
propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : [],
required,
shownPropertyKeys: Object.keys(shownProperties),
shownPropertyCount: Object.keys(shownProperties).length,
propertyValueKeys: propertyKeys,
propertyValueCount: propertyKeys.length,
dropdownOptionCount: dropdownOptions.length,
dropdownOptionKeys: dropdownOptions.map((option: any) => option?.key ?? option?.text),

Copilot uses AI. Check for mistakes.
});
}, [isRoot, propertiesSchema, required, shownProperties, propertyValues]);

const updateShownProperties = (optionValue: string, _optionText: string) => {
const optionKey = optionValue;
if (optionKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,24 @@ export const initializeOperationDetailsForManifest = async (

const { connectorId, operationId } = nodeOperationInfo;
const parsedManifest = new ManifestParser(manifest, OperationManifestService().isAliasingSupported(operation.type, operation.kind));
console.log('[DEBUG StaticResult] operationdeserializer - fetching schema', {
nodeId,
connectorId,
operationId,
manifestOutputs: JSON.stringify(manifest.properties.outputs, null, 2),
});
Comment on lines +372 to +377
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

This file already uses LoggerService for operational logging elsewhere; adding raw console.log calls here bypasses log levels/telemetry sinks and can’t be controlled centrally. Please replace these with LoggerService().log(...) (verbose/trace) and/or guard them behind a debug flag.

Copilot uses AI. Check for mistakes.
const schema = staticResultService.getOperationResultSchema(connectorId, operationId, parsedManifest);
schema.then((schema) => {
if (schema) {
console.log('[DEBUG StaticResult] operationdeserializer - dispatching schema to Redux', {
schemaId: `${connectorId}-${operationId}`,
schemaProperties: schema.properties ? Object.keys(schema.properties) : 'none',
outputsProperties: schema.properties?.outputs?.properties ? Object.keys(schema.properties.outputs.properties) : 'none',
fullSchema: JSON.stringify(schema, null, 2),
});
dispatch(addResultSchema({ id: `${connectorId}-${operationId}`, schema }));
} else {
console.log('[DEBUG StaticResult] operationdeserializer - no schema returned for', { connectorId, operationId });
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import type { PanelTabFn, PanelTabProps } from '@microsoft/designer-ui';
import { StaticResultContainer } from '@microsoft/designer-ui';
import { isNullOrUndefined, type OpenAPIV2 } from '@microsoft/logic-apps-shared';
import { useCallback } from 'react';
import { useCallback, useEffect } from 'react';
import { useDispatch } from 'react-redux';

export const TestingPanel: React.FC<PanelTabProps> = (props) => {
Expand All @@ -27,6 +27,25 @@ export const TestingPanel: React.FC<PanelTabProps> = (props) => {
const staticResultOptions = parameterStaticResult?.staticResultOptions;
const properties = useStaticResultProperties(name);

// Debug logging for Testing tab
useEffect(() => {
console.log('[DEBUG StaticResult] TestingPanel rendered', {
selectedNode,
connectorId,
operationId,
schemaId: `${connectorId}-${operationId}`,
hasSchema: !!staticResultSchema,
schemaProperties: staticResultSchema?.properties ? Object.keys(staticResultSchema.properties) : 'none',
outputsProperties: staticResultSchema?.properties?.outputs?.properties
? Object.keys(staticResultSchema.properties.outputs.properties)
: 'none',
bodySchema: staticResultSchema?.properties?.outputs?.properties?.body
? JSON.stringify(staticResultSchema.properties.outputs.properties.body, null, 2)
: 'none',
currentProperties: properties,
Comment on lines +30 to +45
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

This effect logs on every render and includes full schema/body JSON and current properties. That can be very noisy (and potentially expose user/workflow details in the console). Please gate this behind an explicit debug flag (dev-only/localStorage toggle) and prefer logging small summaries (ids/keys) rather than full serialized schemas.

Suggested change
// Debug logging for Testing tab
useEffect(() => {
console.log('[DEBUG StaticResult] TestingPanel rendered', {
selectedNode,
connectorId,
operationId,
schemaId: `${connectorId}-${operationId}`,
hasSchema: !!staticResultSchema,
schemaProperties: staticResultSchema?.properties ? Object.keys(staticResultSchema.properties) : 'none',
outputsProperties: staticResultSchema?.properties?.outputs?.properties
? Object.keys(staticResultSchema.properties.outputs.properties)
: 'none',
bodySchema: staticResultSchema?.properties?.outputs?.properties?.body
? JSON.stringify(staticResultSchema.properties.outputs.properties.body, null, 2)
: 'none',
currentProperties: properties,
// Debug logging for Testing tab (dev-only, gated by localStorage flag)
useEffect(() => {
// Only log in non-production environments
if (process.env.NODE_ENV === 'production') {
return;
}
// Ensure we're in a browser environment with localStorage
if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') {
return;
}
const isDebugEnabled = window.localStorage.getItem('LA_DESIGNER_STATICRESULT_DEBUG') === 'true';
if (!isDebugEnabled) {
return;
}
const schemaProperties = staticResultSchema?.properties;
const outputsProperties = schemaProperties && 'outputs' in schemaProperties ? (schemaProperties as any).outputs?.properties : undefined;
const hasBodySchema = !!(outputsProperties && 'body' in outputsProperties);
const propertyKeys =
properties && typeof properties === 'object' ? Object.keys(properties as Record<string, unknown>) : [];
console.log('[DEBUG StaticResult] TestingPanel rendered', {
selectedNode,
connectorId,
operationId,
schemaId: `${connectorId}-${operationId}`,
hasSchema: !!staticResultSchema,
schemaPropertyKeys: schemaProperties ? Object.keys(schemaProperties) : [],
outputsPropertyKeys: outputsProperties ? Object.keys(outputsProperties) : [],
hasBodySchema,
propertyKeys,

Copilot uses AI. Check for mistakes.
});
}, [selectedNode, connectorId, operationId, staticResultSchema, properties]);

const selectPanelTabFn = isPanelPinned ? setPinnedPanelActiveTab : setSelectedPanelActiveTab;

const savePropertiesCallback = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export const getStaticResultSchemaForAPIConnector = (
parser: SwaggerParser | ManifestParser
): Promise<StaticResultRootSchemaType | undefined> => {
const outputSchema = parser.getOutputSchema(operationId);
console.log('[DEBUG StaticResult] getStaticResultSchemaForAPIConnector called', {
operationId,
parserType: parser.constructor.name,
outputSchema: JSON.stringify(outputSchema, null, 2),
});
Comment on lines +18 to +22
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

These debug logs are unconditional and will ship to production bundles for a shared library. This adds noise and can leak workflow/schema details in customer consoles. Please gate this behind an explicit debug flag (e.g., dev-only build, env var, or localStorage toggle) and/or route through the repo’s LoggerService at a verbose level so it can be disabled centrally.

Copilot uses AI. Check for mistakes.
return wrapOutputsSchemaToOperationSchema(outputSchema);
};

Expand All @@ -28,10 +33,21 @@ const wrapOutputsSchemaToOperationSchema = (outputSchema: OpenApiSchema): Promis
if (outputSchema) {
const newSchema = cleanDynamicSchemaParameters(clone(outputSchema));
schema.properties.outputs.properties.body = newSchema;
console.log('[DEBUG StaticResult] wrapOutputsSchemaToOperationSchema', {
originalOutputSchema: JSON.stringify(outputSchema, null, 2),
cleanedSchema: JSON.stringify(newSchema, null, 2),
finalBodySchema: JSON.stringify(schema.properties.outputs.properties.body, null, 2),
});
Comment on lines +36 to +40
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The debug logging stringifies the entire schema payload multiple times (original, cleaned, final). This can be quite expensive for large schemas and makes logs hard to scan. Consider logging only high-level details (e.g., top-level keys) or deferring deep serialization behind an explicit debug flag.

Copilot uses AI. Check for mistakes.
} else {
schema.properties.outputs.properties.body = {};
console.log('[DEBUG StaticResult] wrapOutputsSchemaToOperationSchema - no outputSchema, using empty body');
}

console.log('[DEBUG StaticResult] Final wrapped schema', {
schemaKeys: Object.keys(schema.properties),
outputsKeys: Object.keys(schema.properties.outputs.properties),
});

return Promise.resolve(schema);
};

Expand All @@ -47,6 +63,9 @@ const cleanDynamicSchemaParameters = (schema: OpenAPIV2.SchemaObject): OpenAPIV2

const currSchema = schema;
if (currSchema[ExtensionProperties.DynamicSchema]) {
console.log('[DEBUG StaticResult] cleanDynamicSchemaParameters - found dynamic schema, stripping to title only', {
title: currSchema.title,
});
return { title: currSchema.title };
}

Expand Down
Loading