Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data element circular reference detected #5

Closed
alcazes opened this issue Oct 31, 2023 · 5 comments
Closed

Data element circular reference detected #5

alcazes opened this issue Oct 31, 2023 · 5 comments

Comments

@alcazes
Copy link

alcazes commented Oct 31, 2023

Expected Behaviour

We should be able to reference a data element inside another data element

Actual Behaviour

Error

{
    "name": "evaluatingRule",
    "timestampMs": 1698750499741,
    "attributes": {
        "logLevel": "error"
    },
    "messages": [
        "🚀",
        "Failed to execute \"Make Fetch Call\". Data element circular reference detected: platform -> eventType -> lifecycleShortCode -> eventType \n Error: Failed to execute \"Make Fetch Call\". Data element circular reference detected: platform -> eventType -> lifecycleShortCode -> eventType\n    at worker.js:1:6395\n    at worker.js:1:6063\n    at Array.map (<anonymous>)\n    at worker.js:1:5979\n    at getSettings (worker.js:1:10866)\n    at worker.js:1:6602\n    at worker.js:1:6063\n    at Array.map (<anonymous>)\n    at worker.js:1:5979\n    at getSettings (worker.js:1:13752)"
    ],
    "logLevel": "log",
    "context": {
        "ruleId": "RL8ff0fa7212044c8292174187be01e09f"
    }
},

Sample Code that illustrates the problem

There seems to be a bug in Adobe Event Forwarding:
Event Forwarding Error

Data Elements are as follow:
data elements

platform
platform

eventType
eventType

lifecycleShortCode
lifecycleShortCode

@dompuiu
Copy link
Member

dompuiu commented Nov 1, 2023

@alcazes Can you provide a URL of the rule where you see this error. Or provide a screenshot of the Make Fetch call action config? Thanks!

@alcazes
Copy link
Author

alcazes commented Nov 2, 2023

@dompuiu the URL is https://experience.adobe.com/#/@rbs/sname:prod/data-collection/eventForwarding/companies/COe5253eb028b44a8dbe0d4830477b7be6/properties/PR3f4c299f27f541dfbcd290cd3b62a916/rules/RL4c17b6ad344544e292dc5ac035f1c21f/ruleComponent/RCf5fc04e3ad5f4f63b27c6d44693ff1cb

The part of the rule which creates the issue is this one:
image

I also opened an issues on adobe/reactor-extension-core-edge#7 for the same behaviour.

I dig a bit dipper and I believe the issue is no even with your extensions but the turbine source code:
https://github.com/adobe/reactor-turbine-edge/blob/2117c319c32ed3315e004dc027da348eba18a5b3/src/createGetDataElementValue.js#L38

if (dataElementCallStack.includes(dataElementName)) {
    dataElementCallStack.push(dataElementName);

    return Promise.reject(
        new Error(
            `Data element circular reference detected: ${dataElementCallStack.join(
            ' -> '
          )}`
        )
    );
}

Based on this code you cannot create a data element to be reused in other data elements like in my case:

  • eventType is initially used in the Fetch to return a value
  • lifecycleShortCode is then used in payload of the Fetch request to return the application lifecycle and the logic of this data element relies on eventType to return correct value.
  • Based on code snipset above the following eventName will be pushed in call stack eventType ==> lifecycleShortCode ==> eventType. When last eventType is pushed the circular reference error will be triggered.

Based on all that it seems that for now you cannot use a data element in other data elements as you would do with Adobe Launch.

I also create an Adobe support ticket for same E-001072880

Should I open an issue against reactor-turbine or your team will follow up ?

@dompuiu
Copy link
Member

dompuiu commented Nov 2, 2023

Yes, the issue is in reactor-turbine-edge. Thanks for logging this issue. We'll take it from here.

dompuiu added a commit to adobe/reactor-turbine-edge that referenced this issue Nov 16, 2023
… called with a list of data elements that don't have circular references.

This fixes this issue:
adobe/reactor-extension-cloud-connector-edge#5.
@dompuiu
Copy link
Member

dompuiu commented Nov 16, 2023

This issue is fixed in this release: https://github.com/adobe/reactor-turbine-edge/releases/tag/v2.3.3.

@dompuiu dompuiu closed this as completed Nov 16, 2023
@dompuiu
Copy link
Member

dompuiu commented Jan 17, 2024

This fix was deployed today in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants