Skip to content

Conversation

@takyyon
Copy link
Contributor

@takyyon takyyon commented Jan 23, 2026

Summary

  • Add debug logging throughout the static result schema pipeline to help diagnose issues where Testing tab fields don't match actual action outputs

Debug Points Added

Logs added at key points in the schema flow:

  1. Schema generation (apiConnector.ts) - Logs when schema is fetched from parser
  2. Schema dispatch to Redux (operationdeserializer.ts) - Logs the full schema being stored
  3. TestingPanel component (testingTab/index.tsx) - Logs what schema the Testing tab receives
  4. StaticResultContainer (staticResult/index.tsx) - Logs parsed schema structure
  5. StaticResultProperties (staticResultProperties.tsx) - Logs dropdown options and shown fields

How to Use

  1. Start the standalone app: pnpm run start
  2. Open browser DevTools Console
  3. Filter by [DEBUG StaticResult]
  4. Load a workflow with an action
  5. Click on the action and go to the Testing tab
  6. Watch the console for the schema flow

Test plan

  • Load a workflow with API connector actions (e.g., SharePoint "Get lists")
  • Verify debug logs appear in console when clicking Testing tab
  • Logs should show the schema at each step of the pipeline

🤖 Generated with Claude Code

Add debug logging throughout the static result schema pipeline to help
diagnose issues where Testing tab fields don't match actual action outputs.

Logs added at:
- Schema generation (apiConnector.ts)
- Schema dispatch to Redux (operationdeserializer.ts)
- TestingPanel component render (testingTab/index.tsx)
- StaticResultContainer parsing (staticResult/index.tsx)
- StaticResultProperties dropdown (staticResultProperties.tsx)

Filter console by '[DEBUG StaticResult]' to trace the schema flow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 23, 2026 00:19
@github-actions
Copy link

🤖 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: debug(designer): Add console logs to trace static result schema flow
  • Issue: Title is clear and descriptive. It communicates intent and scope well. (Note: the PR template's Commit Type section expects a checkbox selection in the body — see below.)
  • Recommendation: Keep the title. Consider using one of the canonical commit types in the PR body (e.g., chore) to match repository conventions.

Commit Type

  • No commit type checkbox is selected in the PR body.
  • Note: The PR template requires exactly one commit type selected. This PR is primarily adding debugging instrumentation (console logs) and should be labeled appropriately — chore is the closest match.
  • Recommendation: In the PR body, check a single box under Commit Type, e.g.: - [x] chore and add a short line explaining why chore.

Risk Level

  • No risk level checkbox was selected and there is no risk:* label on the PR.
  • Assessment: Based on the code diff, this change adds multiple console.log statements that print JSON-stringified schemas and properties at several layers (parser, dispatcher, UI). While this is NOT a functional API or algorithm change, it can leak potentially sensitive data to browser consoles and will increase runtime noise. Because of that potential for data exposure and the wide surface (5 files changed in core UI and deserialization pipeline), I advise risk:medium.
  • Recommendation: Add the label risk:medium to the PR and check the corresponding checkbox in the PR body. If maintainers want to keep this as lower risk, explain why (e.g., logs are gated behind a dev-only flag, stripped in prod builds, or limited to non-sensitive fields).

What & Why

  • Current: The PR body has a Summary and Debug Points Added section describing where logs were added.
  • Issue: This section is acceptable and informative, but it should be slightly expanded to explicitly call out the potential privacy/security implications of logging full schema bodies (e.g., JSON.stringify(schema)), and whether these logs are intended to ship to production or only used locally.
  • Recommendation: Keep the current content, and add a short paragraph: why printing full schemas is safe (or not), and whether these console logs will be removed or gated before merge/release.

Impact of Change

  • The PR body does not contain an Impact of Change section populated with clear Users/Developers/System impacts.
  • Assessment: The changes affect multiple layers (schema parsing, dispatch to Redux, UI rendering) and could surface personally identifiable or sensitive schema values in browser consoles. They also add noise to logs and may affect performance slightly in hot paths.
  • Recommendation: Fill out the Impact of Change section. Example suggestions to copy/update:
    • Users: No direct UX changes; only developer-facing console output when the Testing tab is used. Potential risk of exposing sensitive schema data to the console if used in production.
    • Developers: Easier debugging of static result schema flow. Recommend using a debug-level logger or gating logs behind a feature flag/environment check.
    • System: Minimal CPU/memory overhead. Ensure JSON.stringify of large schemas will not cause noticeable slowdown; consider limiting size or sampling.

Test Plan

  • Assessment: The PR includes a Test plan checklist but none of the test checkboxes are checked and no automated tests are included in the diff.
  • Issue: For code changes (even debug logs), the repo policy requires either automated tests or a solid justification why none are added. This PR added no unit/E2E tests and did not explain why. That should fail the check per the template rules.
  • Recommendation: Either:
    • Add a small unit test around the schema-wrapping function(s) to ensure behavior unchanged by the instrumentation, or
    • Mark Manual testing completed and provide precise manual test steps and expected console outputs. Additionally, add a short explanation why automated tests are not applicable for these console.log additions.

⚠️ Contributors

  • Assessment: The Contributors section is blank. Blank is allowed but we recommend crediting reviewers/designers/PMs when applicable.
  • Recommendation: Optionally add contributors or leave blank if none.

⚠️ Screenshots/Videos

  • Assessment: Not applicable for this non-visual change.
  • Recommendation: No screenshots required.

Summary Table

Section Status Recommendation
Title Keep the title. Add matching Commit Type in body.
Commit Type Select exactly one type in the PR body (suggest chore).
Risk Level Add risk:medium label and checkbox in body; explain any mitigating controls.
What & Why Add a note about privacy/security of logged schema.
Impact of Change Populate Users/Developers/System impacts and call out potential data exposure.
Test Plan Add automated tests or a clear manual test confirmation + justification.
Contributors ⚠️ Optional: add contributors if applicable.
Screenshots/Videos ⚠️ Not applicable.

Final message
This PR does not pass the PR body checklist. Primary reasons:

  • No Commit Type selected in the PR body (required).
  • No Risk Level selected and no risk label on the PR (required). I advise risk:medium due to potential data exposure from JSON-stringified schemas printed at several layers.
  • No automated tests added and no justification for skipping tests (the PR should either contain tests or a clear manual testing + rationale).

Action items to get this PR accepted:

  1. Edit the PR body and set Commit Type to exactly one option. Suggested: - [x] chore with a one-line note: "Adding debug logs for local troubleshooting; will be gated/removed before production if necessary."
  2. Add a Risk Level checkbox and label. Suggested: - [x] Medium - Potential for verbose logs and schema data exposure and add the GitHub label risk:medium to the PR.
  3. Update the What & Why to explicitly mention whether the logs will remain in production and any mitigating controls (dev-only flag, guard via environment variable, remove before release).
  4. Expand Impact of Change with separate bullets for Users/Developers/System (copy examples above).
  5. Update the Test Plan: either add unit tests (where reasonable) or mark Manual testing completed and provide the exact steps and expected output. If manual testing is used, explain why automated tests are not appropriate for these console logs.
  6. Consider replacing direct console.log calls with a repo logging utility or guard these logs behind a DEV-only feature flag so that production does not leak potentially sensitive schema data. If keeping console logs is acceptable, explicitly state that these logs will be removed or toggled off before release.

Please update the PR title/body and labels as recommended, then re-submit. Thank you for the clear summary and for adding helpful debug points — once the requested PR metadata and safeguards/tests are added, this should be approvable.


Last updated: Fri, 23 Jan 2026 00:19:49 GMT

@takyyon takyyon marked this pull request as draft January 23, 2026 00:20
@github-actions
Copy link

📊 Coverage check completed. See workflow run for details.

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

Adds diagnostic logging across the “static result schema” flow to trace how an operation’s output schema is generated, stored, and rendered in the Testing tab UI.

Changes:

  • Added debug logs during schema generation/wrapping for API connector operations.
  • Added debug logs when fetching/dispatching static result schemas into Redux during operation initialization.
  • Added debug logs in Testing tab/static result UI components to inspect received/parsed schema and rendered property options.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
libs/logic-apps-shared/src/designer-client-services/lib/staticresultschema/schemas/apiConnector.ts Logs schema generation/cleaning/wrapping for API connector output schemas.
libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/testingTab/index.tsx Logs what schema/properties the Testing tab receives from selectors.
libs/designer/src/lib/core/actions/bjsworkflow/operationdeserializer.ts Logs schema fetch/dispatch timing and payload during manifest operation init.
libs/designer-ui/src/lib/staticResult/staticResultProperties.tsx Logs dropdown options and shown fields used for static result property rendering.
libs/designer-ui/src/lib/staticResult/index.tsx Logs parsed schema result produced by parseStaticResultSchema.

Comment on lines +30 to +45
// 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,
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.
Comment on lines +175 to +182
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;
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.
Comment on lines +31 to +39
// 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),
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.
Comment on lines +18 to +22
console.log('[DEBUG StaticResult] getStaticResultSchemaForAPIConnector called', {
operationId,
parserType: parser.constructor.name,
outputSchema: JSON.stringify(outputSchema, null, 2),
});
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.
Comment on lines +36 to +40
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),
});
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.
Comment on lines +372 to +377
console.log('[DEBUG StaticResult] operationdeserializer - fetching schema', {
nodeId,
connectorId,
operationId,
manifestOutputs: JSON.stringify(manifest.properties.outputs, null, 2),
});
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants