Repository navigation
MOBILE-621: Hold the IDFA set before initialize until the flag is known - #251
Merged
Merged
Conversation
disableTrackingIds lives only in JS. A JS reload without a process restart (expo-updates reloadAsync, react-native-restart) resets it while the native SDK stays initialized, so an IDFA set before the next initialize reached the tracking host although the app had turned tracking ids off. Found on the acceptance stand with a deferred initialize.
There was a problem hiding this comment.
🟡 Changes recommended
Consent withdrawal after a JS-only reload can leave the previous IDFA in native state until deferred initialization; clearing values must be forwarded immediately and covered by a regression test.
1 open issue
What changed in this PR
This PR defers forwarding IDFA values until the current JavaScript context knows disableTrackingIds, addressing JS-only reloads where the native SDK remains initialized.
Changes:
- Buffers the latest identifier before initialization, then forwards it or clears it according to the tracking flag.
- Documents deferred forwarding and adds four tests covering buffering, call order, consent withdrawal, and setters during initialization.
| File | Description |
|---|---|
src/index.tsx |
Adds pending-identifier handling and updates setter documentation. |
src/__tests__/index.test.ts |
Adds coverage for identifier handling before and during initialization. |
Review effort: Balanced
enotniy
self-requested a review
November 20, 2026 12:09
enotniy
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

https://tracker.yandex.ru/MOBILE-621
disableTrackingIdslives only in JS. A JS reload without a process restart (expo-updatesreloadAsync, react-native-restart) resets it while the native SDK stays initialized, sosetAdvertisingIdentifier(idfa)called before the nextinitializesent the IDFA to the tracking host although the app had turned tracking ids off. Found on the acceptance stand with a deferredinitialize.Until
initializeruns in the current JS context, the setter keeps the last value in JS.initializepassesnull(flag on) or that value (flag off) to native before the native initialization, so a cold start reaches native in the same order as before. No native change.Checked: jest and eslint; the first new test fails on develop, the other three were seen red on a one-line break of the line each guards.