Skip to content

[FFL-3355] Add independent native OpenFeature tracking hooks - #1507

Draft
sameerank wants to merge 8 commits into
developfrom
sameerank/FFL-3355/native-tracking-hooks
Draft

sameerank wants to merge 8 commits into
developfrom
sameerank/FFL-3355/native-tracking-hooks

Conversation

@sameerank

@sameerank sameerank commented Oct 21, 2026 •

Copy link
Copy Markdown

What does this PR do?

Add independent native-backed OpenFeature tracking hooks for DatadogCoreProvider on Android only (FFL-3355):

  • createDatadogExposureLoggingHook, createDatadogEvaluationLoggingHook, and createDatadogRumTrackingHook.
  • composeDatadogTrackingHooks with explicit initialization/shutdown, aligned with the browser hook API.
  • Separate exposure, evaluation, and RUM bridge operations for both Android RN architectures, preserving the existing combined operation.
  • Upgrade Android native dependencies to 3.16.0 and expose the Android evaluation-intake endpoint override.
  • On iOS, leave the new hooks inactive with a one-time warning per hook during initialization. Direct calls to the shared independent-tracking bridge methods reject with UNSUPPORTED_PLATFORM.
  • Add platform, bridge, hook-lifecycle, client-isolation, and error/default regression tests and usage documentation.

Hooks submit asynchronously without JS batching. Shutdown disables the hooks but does not own or stop the shared native SDK. Site, consent, storage, aggregation, and upload remain native SDK responsibilities.

Motivation

Rules-based JS evaluation needs independently selectable tracking without triggering every native tracking operation or maintaining a second JS telemetry pipeline. This PR delivers that capability on Android without changing the installation requirements for existing iOS customers.

Additional Notes

Platform scope and native dependencies

  • Android: uses released native SDK 3.16.0, which includes the independent tracking APIs from FFL-3355: Add independent native flag tracking operations dd-sdk-android#4012. Both legacy and new-architecture bridge implementations are included.
  • iOS: stays on native SDK 3.16.1, with existing deployment targets and CocoaPods installation unchanged. Existing providers, flag evaluation, and automatic tracking are unaffected.
  • Use matching core and OpenFeature RN package releases containing the tracking APIs. A missing core tracking helper on Android produces a one-time warning and leaves that hook inactive.

Why iOS is deferred

The native iOS APIs from DataDog/dd-sdk-ios#3329 are available in SDK 3.21.0, but that release is not currently available on CocoaPods Trunk and raises the native minimum from iOS/tvOS 12 to 15.

We validated a Git-pinned CocoaPods workaround, but it would require existing CocoaPods-based RN applications to add explicit native Datadog pod overrides to their own Podfiles. Because the native dependencies belong to the core RN SDK, this requirement and the deployment-target increase would affect customers who do not use the flagging provider or tracking hooks. Without those overrides, pod install would fail.

This PR deliberately avoids imposing that installation change. iOS support is deferred until the native dependency distribution and deployment-target migration can be handled explicitly in a separate follow-up with the mobile maintainers. The broader Swift Package Manager migration (#1455) remains separate.

The shared TurboModule interface still includes the new methods, so iOS supplies explicit unsupported-platform responses rather than silently reporting successful tracking. Hook initialization on iOS disables the hook without affecting evaluation; applications that never initialize the optional hooks receive no new warning.

Validation

Validated locally with React Native 0.76.9; native iOS runs used Xcode 26.2 and an iPhone 17 Pro / iOS 26.0 simulator:

  • 164 OpenFeature tests passed, including Android hook behavior, missing-helper compatibility, and all three hooks remaining inactive on iOS for both rules-based and precomputed configurations.
  • 82 core flag JavaScript tests passed, including existing provider tracking.
  • 210 iOS core tests passed on each architecture, using the original published native SDK 3.16.1, including explicit rejection of the independent methods and existing combined tracking.
  • pod install succeeded for both iOS example configurations without native Git overrides.
  • Targeted ESLint, the OpenFeature TypeScript check, and git diff --check passed.

These results replace the earlier stacked-branch validation note; fetch-helper tests are not part of this PR. Full CI for the latest commit remains to be checked. Android end-to-end upload verification and Android/physical-device Release performance measurements are not claimed by this validation.

Performance

Tracking uses asynchronous native bridge calls without JS-side batching. Current Android performance, physical-device Release performance, and frame impact remain unmeasured.

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

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1ebc9bc | Docs | View more details | Give us feedback!

Route independent RUM hooks through the selected native Flags client and preserve telemetry opt-out. Warn once when core tracking helpers are unavailable, with regression coverage and updated usage guidance.

Ref: FFL-3355
Keep the new tracking hooks Android-only and preserve the existing iOS dependency and installation requirements. Disable optional hooks on iOS with a one-time warning and reject direct independent bridge calls as unsupported. Add platform regression coverage and document the deferred iOS rollout.
Preserve successful DEFAULT assignments in independent tracking hooks. Send only tracking metadata to native and avoid serializing flag values. Add rules/precomputed regression tests and sparse Android payload coverage.
@cdn34dd cdn34dd added the flags label Nov 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants