Skip to content

ExperienceEvent constructor misroutes data into xdm when xdmData is omitted #571

@s10-steve

Description

@s10-steve

Prerequisites

  • This is not a Security Disclosure, otherwise please follow the guidelines in Security Policy.
  • I have searched in this repository's issues to see if it has already been reported.
  • I have updated to the latest released version of the SDK and the issue still persists.

Bug summary

Creating an ExperienceEvent with only a data property and no xdmData property results in the data payload being incorrectly placed inside the xdm object rather than as a separate top-level data object. This behaviour is undocumented and produces an unexpected Edge Network payload.

Environment

OS: iOS 26.2

Steps to reproduce

Call the following sendEvent

import { Edge, ExperienceEvent } from '@adobe/react-native-aepedge';

const screenData = { screen: { name: 'home' } };

// Only data provided
const event = new ExperienceEvent({ data: screenData });
Edge.sendEvent(event);

Resulting Payload

  • Actual: { xdm: { data: { screen: { name: 'home' } } } }
  • Expected: { data: { screen: { name: 'home' } } }

Current behavior

Creating an ExperienceEvent with only a data property and no xdmData property results in the data payload being incorrectly placed inside the xdm object rather than as a separate top-level data object.

Expected behavior

Based on the documentation I'd expect that the sendEvent function accepts both xdmData and data parameters. It does not state that xdmData is a prerequisite for data to be correctly positioned in the payload.

I would expect that an event with only data is sent successfully, with data as a top-level object in the Edge Network payload. If xdm is truly required, the SDK should return a clear error — not silently misroute the data.

Anything else?

Seems like this is caused by the ExperienceEvent typeScript constructor, which uses 'xdmData' in argsOrXdmData to distinguish between the named-argument form and the legacy positional form. When only data is provided, the entire data object is assigned to [this.xdmData], so the bridge sends it as XDM content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage-requiredTriage required on a new issue logged for this project. Used by issue templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions