Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
77 stars 83 forks source link

Logic App new designer crashes when inserting expression to a child Logic App call with fields that accept null #5608

Closed peramhe closed 1 month ago

peramhe commented 1 month ago

Describe the Bug with repro steps

  1. Create a consumption Logic App named "child"
  2. Edit "child" Logic App. Add "When a HTTP request is received" trigger and define request body schema that accepts a null for a property for example
{
    "type": "object",
    "properties": {
        "Property1": {
            "type": [
                "string",
                "null"
            ]
        }
    }
}
  1. Create a consumption Logic App named "parent"
  2. Edit "parent" Logic App. Add "When a HTTP request is received" trigger (the type of the trigger is not important) and an action to call "child" Logic App.
  3. Click the field "Body Property1" and then select the "fx" icon from the hovering menu on the left.
  4. Editor crashes with "The renderComponentIntoRoot component encountered an error while loading."
{  "shellProps": {    "sessionId": "56c71b26794d4d4fb84bb7fa21e4ba3e",    "extName": "Microsoft_Azure_EMA",    "contentName": "DesignerEditorConsumption.ReactView"  },  "error": {    "message": "The renderComponentIntoRoot component encountered an error while loading.",    "metadata": {      "area": "renderComponentIntoRoot"    },    "error": {      "data": {        "message": "The renderComponentIntoRoot component encountered an error while loading.",        "metadata": {          "area": "renderComponentIntoRoot"        },        "capturedErrors": [          {            "message": "Error caught in error boundary",            "metadata": {              "area": "renderComponentIntoRoot",              "error": {                "stack": "TypeError: Cannot read properties of undefined (reading 'some')\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10921434\n    at Array.filter (<anonymous>)\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10921236\n    at Array.map (<anonymous>)\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10921205\n    at getTokenPicker (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10921689)\n    at Pce (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9913030)\n    at fn (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:43441)\n    at Vn (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:50260)\n    at lc (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:112118)\n    at Ar (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:77654)\n    at Dr (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:77582)\n    at Lr (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:77445)\n    at Tr (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:74440)\n    at https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:30184\n    at unstable_runWithPriority (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:50:7430)\n    at Et (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:29961)\n    at Ot (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:30129)\n    at Pt (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:30064)\n    at ua (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:115725)\n    at ye (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:60:15547)",                "message": "Cannot read properties of undefined (reading 'some')",                "name": "TypeError"              },              "errorInfo": {                "componentStack": "\n    at Pce (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9910688)\n    at q2 (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9256621)\n    at div\n    at aae (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9735658)\n    at zae (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9748866)\n    at Xhe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10065078)\n    at div\n    at Qhe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10064619)\n    at div\n    at div\n    at div\n    at kKe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10904822)\n    at wKe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10903399)\n    at AKe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10915806)\n    at div\n    at TKe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10913240)\n    at div\n    at div\n    at Rde (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9944253)\n    at div\n    at div\n    at div\n    at div\n    at span\n    at $M (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8626783)\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8893964\n    at t.Provider (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8750993)\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8887477\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8901178\n    at Xde (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:9952602)\n    at UKe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10928250)\n    at cYe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10947325)\n    at lu (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5875354)\n    at div\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5875762\n    at Is (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5825707)\n    at su (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5875027)\n    at div\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10370420\n    at vMe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10370987)\n    at OYe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10959436)\n    at div\n    at mWe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10735125)\n    at vWe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10735537)\n    at Pg (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:7911441)\n    at t (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5895804)\n    at jg (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:7911568)\n    at div\n    at div\n    at UT (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:8581442)\n    at https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10167143\n    at div\n    at t.FocusRectsProvider (https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:289:273)\n    at https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:197:437\n    at aWe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10733488)\n    at R (https://reactblade.portal.azure.net//Content/Dynamic/wvqRmzcFOmrg.js:63:12498)\n    at sWe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10733632)\n    at div\n    at t (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5340709)\n    at div\n    at c1e (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:11119145)\n    at ie (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:5716561)\n    at kIe (https://afd-v2.hosting.portal.azure.net/ema/Content/Dynamic/0LvT04afddPS.js:3:10507170)\n    at m1e\n    at l (https://portal.azure.com/Content/Dynamic/UfbgXxlzU5QA.js:18:1470)\n    at m1e\n    at div\n    at div\n    at div\n    at t.FocusRectsProvider (https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:289:273)\n    at https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:146:477\n    at https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:340:435\n    at t (https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:309:430)\n    at div\n    at t.FocusRectsProvider (https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:289:273)\n    at https://portal.azure.com/Content/Dynamic/2xK498c05gVZ.js:197:437\n    at t.ThemedFabric (https://portal.azure.com/Content/Dynamic/oYA3KeNTOx0h.js:8:1585)"              }            }          }        ]      }    },    "code": null  }}

What type of Logic App Is this happening in?

Consumption (Portal)

Which operating system are you using?

Windows

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

Child Logic App:

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {},
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "inputs": {
                    "schema": {
                        "properties": {
                            "Property1": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "type": "object"
                    }
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {}
        }
    }
}

Parent Logic App:

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "child": {
                "inputs": {
                    "host": {
                        "triggerName": "manual",
                        "workflow": {
                            "id": "/subscriptions/<subscription_id>/resourceGroups/logicapp-bug-test/providers/Microsoft.Logic/workflows/child"
                        }
                    }
                },
                "runAfter": {},
                "type": "Workflow"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {}
        }
    }
}

Screenshots or Videos

No response

Browser

Edge Version 128.0.2739.63 (Official build) (64-bit)

Additional context

I also have an older Logic App in a customers' production environment that has a call to a child Logic App accepting null properties similar to the example above. This Logic App was created using the Legacy designer (before the new designer was in GA). Now when viewed in the new designer, the action to call the child Logic App does not show any fields for properties that accept nulls at all, even though defined in the Logic App definition JSON. Unfortunately, I'm unable to reproduce this specific behavior in my own test tenant with newly created Logic Apps.

rllyy97 commented 1 month ago

Hi @peramhe, was this ever working for the customer in new designer or was this always not working?

peramhe commented 1 month ago

Hi @peramhe, was this ever working for the customer in new designer or was this always not working?

I think this is the first time I've used the new designer in this scenario. So I can't say whether this is a new issue or not. Overall, I've used the new designer quite a lot but never seen it crashing before.

Eric-B-Wu commented 1 month ago

Thanks for reporting this issue @peramhe, I've created a fix for this which will be out in our next release which is planned for 9/20

peramhe commented 1 month ago

Thought that I'd share this even though the fix has already been scheduled @preetriti1 @Eric-B-Wu

I opened another previously created Logic App in a customers' environment and noticed that an action to call a child Logic App displayed an error. This child Logic App also accepts nulls to some of its parameters.

2024-09-10 15_39_42

Failed to retrieve dynamic inputs. Error details: 'Cannot read properties of undefined (reading 'map')'

I decided to ignore this error and edited some other action in the flow and saved. I then went to "Logic App code view" to double check the changes I made, just to realize that parameters for the child Logic App call (inputs.body) had been completely removed from the definition. Hope this also gets fixed because it's very easy for a developer to miss that the error causes unintended changes to the flow when saving.