Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change that defers pre-initialization identifier forwarding until the isolate’s tracking preference is known.
No open issues 🎉
What changed in this PR
Prevents an IDFA set before initialization from reaching the iOS SDK before the current Dart isolate’s disableTrackingIds setting is known. This protects restarted or newly created isolates when the native SDK remains initialized, without native changes.
Changes:
- Adds a gate that holds the latest pre-init identifier and forwards it—or
nullwhen tracking IDs are disabled—before native initialization. - Routes the
Mindboxfacade through the gate and documents the deferred behavior. - Adds tests for disabled tracking, enabled tracking, and consent withdrawal before initialization.
| File | Description |
|---|---|
mindbox/test/advertising_identifier_gate_test.dart |
Tests pre-init buffering and identifier forwarding for three consent scenarios. |
mindbox/lib/src/advertising_identifier_gate.dart |
Adds per-isolate buffering and tracking-flag enforcement. |
mindbox/lib/mindbox.dart |
Integrates the gate and documents pre-init identifier handling. |
Review effort: Balanced
disableTrackingIds lives only in the Dart isolate. A new isolate in a live process (restart_app's iOS engine restart, an add-to-app host that re-creates its FlutterEngine, a plugin's background engine) starts with the flag off while the native SDK stays initialized, so an IDFA set before that isolate's init reached the tracking host although the app had turned tracking ids off. Same flaw as the React Native JS reload found on the acceptance stand. The rule moves into its own type so that a test can start from a fresh instance; the Mindbox facade is a per-isolate singleton.
justSmK
force-pushed
the
feature/MOBILE-621-idfa-before-init
branch
from
November 20, 2026 15:33
a9768d1 to
0784eb5
Compare
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
The Flutter twin of mindbox-cloud/react-native-sdk#251.
disableTrackingIdslives only in the Dart isolate. A new isolate in a live process (restart_app's iOS engine restart, an add-to-app host that re-creates itsFlutterEngine, a plugin's background engine) starts with the flag off while the native SDK stays initialized, sosetAdvertisingIdentifier(idfa)called before that isolate'sinitsent the IDFA to the tracking host although the app had turned tracking ids off.Until
initruns in the isolate, the setter keeps the last value in Dart.initpassesnull(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.The rule moved into
AdvertisingIdentifierGate, because theMindboxfacade is a per-isolate singleton that tests in one file share; the tests start from a fresh gate.Checked:
flutter analyzeandflutter testinmindboxwith local path dependencies. The first and third new tests fail on develop's behaviour; the second and third were seen red on a one-line break of the line each guards.