SAP / open-ux-odata

Enable community collaboration to jointly promote and facilitate best in class framework and tooling capabilities when working with OData services.
Apache License 2.0
51 stars 12 forks source link

BUG - Influencing V2 entity set behavior throws error #673

Closed sb-aigh closed 1 year ago

sb-aigh commented 1 year ago

Description

When using the feature to influence entity set behavior using .js file implementing function executeAction(), the mockserver returns an error like Cannot read properties of undefined (reading 'toString') for unbound actions (V2). The issue seems to be located in dataAccess.ts. The resulting outdata is a not resolved here, hence causing the below coding to fail.

Expected results

Mockserver returns the custom data returned in function executeAction().

Actual results

Mockserver returns an error.

Version/Components/Environment

2.1.114

nlunets commented 1 year ago

What does your executeAction looks like, it's a bit difficult to judge where the bug might be without this as we have tests validating the behavior of the executeAction in v2 on EntityContainer.

sb-aigh commented 1 year ago

The function simply looks like the following:

module.exports = {

    executeAction: function (actionDefinition, _actionData, _keys, _odataRequest) {
        if (actionDefinition.name === 'MyUnboundAction') {
            return {
                "ID": "00a4c48c-0dfc-4507-abc6-9b54a431b788",
                "property1": "LDH75DRPTNDHDCERTQWES7AFVY",
                "property2": "EUR"
            };
        }
    }
};
nlunets commented 1 year ago

Most likely fixed by [@sap-ux/ui5-middleware-fe-mockserver@2.1.115]