fix(android): report React Native wrapper type on every selectPlacements call#357
fix(android): report React Native wrapper type on every selectPlacements call#357denischilik wants to merge 1 commit into
Conversation
…nts call The wrapper SDK type was only reported once at module creation. If MParticle was not started yet, or the Rokt kit had not finished initializing, the call was silently dropped and never retried, so the framework type fell back to android. iOS already re-sends the wrapper type on every placement call; this aligns Android with that behavior.
PR SummaryLow Risk Overview Module Reviewed by Cursor Bugbot for commit f2dd324. Bugbot is set up for automated code reviews on this repo. Configure here. |
Summary
On Android, the React Native wrapper SDK type was reported to mParticle only once, in the
MPRoktModuleImplconstructor. That one-shot call is silently dropped in two common cases:MParticle.getInstance()is stillnullwhen the native module is created (mParticle not started yet), and the call is never retried.KitManagerImpl.setWrapperSdkVersiononly forwards to already-active kits and, unlike iOS (which queues kit calls until kits are initialized and replays them), Android has no queuing, so the value is lost.As a result the Rokt SDK falls back to reporting
androidas the framework type for React Native integrations, while iOS correctly reportsreactNative. iOS already re-sends the wrapper type on every placement call; this change aligns Android with that behavior by reporting the wrapper type at the start of everyselectPlacementscall (both old and new architecture), in addition to module creation.Testing Plan
MPRoktModuleImplcovering: wrapper type reported at module creation, reported on each subsequent call, and no crash when mParticle is not started../gradlew test,./gradlew ktlintCheck,./gradlew lint, andtrunk checkall pass locally.reactNativeas the framework type on Android.Master Issue
Closes https://go.mparticle.com/work/REPLACEME