-
Notifications
You must be signed in to change notification settings - Fork 38
Description
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.