Skip to content

[RUM-9771] Fix rum sessionIdListener for new architecture#865

Merged
cdn34dd merged 1 commit into
developfrom
carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch
May 6, 2025
Merged

[RUM-9771] Fix rum sessionIdListener for new architecture#865
cdn34dd merged 1 commit into
developfrom
carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch

Conversation

@cdn34dd
Copy link
Copy Markdown
Contributor

@cdn34dd cdn34dd commented May 2, 2025

What does this PR do?

Fixes bug where event emitter listener for rum session id does not receive events on RN new architecture, due to the fact that we're accessing the native module from the wrong place.

@cdn34dd cdn34dd requested a review from a team as a code owner May 2, 2025 14:17
@cdn34dd cdn34dd changed the title RUM-9771: Fix rum sessionIdListener for new architecture [RUM-9771] Fix rum sessionIdListener for new architecture May 2, 2025
Comment on lines 64 to 73
static initialize = async (
configuration: DdSdkReactNativeConfiguration
): Promise<void> => {
// Register listeners before anything else to avoid events being skipped
registerRumSessionIdListener();

await DdSdkReactNative.initializeNativeSDK(configuration, {
initializationModeForTelemetry: 'LEGACY'
});

DdSdkReactNative.enableFeatures(configuration);
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this leads to the session ID listener to never be registered when using DatadogProvider.

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented May 2, 2025

Datadog Report

Branch report: carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch
Commit report: f1e5381
Test service: dd-sdk-reactnative

✅ 0 Failed, 669 Passed, 1 Skipped, 3.81s Total Time

@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch branch 2 times, most recently from 1052cce to f1e5381 Compare May 5, 2025 10:13
Comment thread packages/core/src/rum/sessionId/sessionIdHelper.ts
- Load turbo/native module conditionally for usage in EventEmitter init
- Improve TS types
@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch branch from f1e5381 to fe6e340 Compare May 6, 2025 15:23
@cdn34dd cdn34dd merged commit 0031bfe into develop May 6, 2025
2 of 8 checks passed
@cdn34dd cdn34dd deleted the carlosnogueira/RUM-9771/fix-event-emitter-event-new-arch branch May 6, 2025 15:28
@sbarrio sbarrio mentioned this pull request May 14, 2025
4 tasks
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

Successfully merging this pull request may close these issues.

3 participants