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 10 forks source link

BUG - exception when Mockserver getParentEntityInterface handler is called #505

Closed c-kobo closed 1 year ago

c-kobo commented 1 year ago

Description

Exception 'Cannot read properties of undefined (reading 'entitySet')' is thrown in FEMockserver.js when the mentioned handler is called. This is a regression as this was working before.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/advancedFeatures/guidance/guidanceSideEffects
  2. Open dev console and open file /sap/fe/core/fpmExplorer/mockdata/ChildEntity.ts
  3. Set a break-point in line 10 const parent: MockDataContributor | undefined = await this.base?.getParentEntityInterface();
  4. In the Sample, expand Side Effect sample 4 (side effect on a source entity)
  5. Change a value in the table column 'Price' and press 'tab'
  6. Exception is thrown in FEMockserver gunction getParentEntitySetName as the path is empty

Screenshots

image

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

c-kobo commented 1 year ago

Tested successfully with fe-mock-server-core 1.1.74 containing fix