Skip to content

Comments

[FIX] Missing events in Expo caused by wrong singleton usage#1156

Merged
marco-saia-datadog merged 1 commit intodevelopfrom
marcosaia/fix/expo-events-missing
Feb 23, 2026
Merged

[FIX] Missing events in Expo caused by wrong singleton usage#1156
marco-saia-datadog merged 1 commit intodevelopfrom
marcosaia/fix/expo-events-missing

Conversation

@marco-saia-datadog
Copy link
Member

What does this PR do?

Ensure singleton consistency across packages by migrating BufferSingleton to the getGlobalInstance pattern and aligning InternalLog usage.

Note

Fixes Missing "API requests", "Actions", and "Other resources" in DataDog RUM after migration to V3.X. The issue was caused by the duplication of the BufferSingleton instance between different imports of DdRum, leading to calls being queued in a separate buffer and never flushed.

Motivation

In Expo (likely due to bundler optimizations), importing the same class from different modules can result in duplicated instances, breaking reliance on static properties for shared state.

To guarantee a single shared instance across the framework ecosystem, we standardize on a globalThis + Symbol.for(key) registry via getGlobalInstance.

Changes

  • Refactored BufferSingleton to use getGlobalInstance.
  • Fixed InternalLog to use the same global singleton mechanism.
  • Ensures a single instance per key across all packages.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

Copy link
Contributor

@sbarrio sbarrio left a comment

Choose a reason for hiding this comment

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

👑

@marco-saia-datadog marco-saia-datadog marked this pull request as ready for review February 20, 2026 16:15
@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner February 20, 2026 16:15
@marco-saia-datadog marco-saia-datadog merged commit 6d1c0c6 into develop Feb 23, 2026
11 checks passed
@marco-saia-datadog marco-saia-datadog deleted the marcosaia/fix/expo-events-missing branch February 23, 2026 08:27
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.

Missing "API requests", "Actions", and "Other resources" in DataDog RUM after migration to V3.X

2 participants