feat: report mParticle API usage through the Rokt kit - #761
Conversation
Rokt diagnostics can identify native SDK API usage, but calls made through mParticle are not distinguishable. This instruments public mParticle core, identity, user, session, messaging, media, and Rokt-facade APIs to forward a bounded, non-sensitive API identifier into the Rokt SDK — only when the Rokt kit is active. Android port of mParticle/mparticle-apple-sdk#813. - Forward diagnostics through the active Rokt kit via a decoupled RoktApiDiagnosticsForwarder interface (core stays free of kit types) using a fixed uppercase code vocabulary. Requires Rokt SDK 6.0.3 and calls its public Rokt.logMParticleApiCall API. - Match the iOS reported-API set: drop identifiers iOS deliberately excludes (single setUserAttribute) and Android-only internal machinery (identity getters/state listeners); rename SET_UPDATE_INTERVAL -> SET_UPLOAD_INTERVAL; add RESET, SET_LOG_LEVEL, GET_INTEGRATION_ATTRIBUTES, GET_ATTRIBUTION_INFO, IS_KIT_ACTIVE, GET_KIT_INSTANCE. - Keep Android-specific public APIs that are neither internal nor noisy (install referrer, non-auto push toggles, media audio state). - Never over-log: suppress diagnostics while SDK/kit internals invoke public APIs (auto-upload, logLtvIncrease -> logEvent, push-token modify, and the Rokt kit's attribute enrichment / event + identity forwarding) via MParticle.withoutRoktApiUsage. - Exclude all API arguments and values from diagnostics; code identifiers only. - Add core tests for active-kit gating and internal-call suppression. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryMedium Risk Overview Core exposes Bumps Reviewed by Cursor Bugbot for commit a696a7b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bfb6cd7. Configure here.
|
|
||
| @Override | ||
| public boolean setUserAttributeList(String key, Object value) { | ||
| MParticle.logRoktApiUsage("SET_USER_ATTRIBUTE_LIST"); |
There was a problem hiding this comment.
User attribute setter not instrumented
Medium Severity
setUserAttribute and bulk setUserAttributes never emit a Rokt usage code, while list, increment, remove, and tag setters do. Partner attribute writes, one of the most common public user APIs, stay invisible in Rokt diagnostics and will not match the Apple identifier set.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bfb6cd7. Configure here.
BrandonStalnaker
left a comment
There was a problem hiding this comment.
Just a few small things
| } | ||
|
|
||
| public void logEvent(@NonNull BaseEvent event) { | ||
| MParticle.logRoktApiUsage("LOG_EVENT"); |
There was a problem hiding this comment.
It might be more useful to move this to logMPEvent and logCommerceEvent and then you could append the event type to the call. Alternatively you coudl just add the event type here.
MParticle.logRoktApiUsage("LOG_EVENT" + NSStringFromEventType(event.type));
There was a problem hiding this comment.
Added bound event types getRoktLogEventDiagnosticCode


Background
Rokt diagnostics can identify native SDK API usage, but calls made through mParticle are not currently distinguishable. This adds bounded, non-sensitive API identifiers only when the Rokt kit is active. It is the Android counterpart to mParticle/mparticle-apple-sdk#813 and requires Rokt SDK
6.0.3, which exposes the publicRokt.logMParticleApiCallentry point.What Has Changed
android-coredecoupled from kit types through aRoktApiDiagnosticsForwarderinterface.LOG_EVENTdiagnostics without exposing event names, attributes, or unrecognized action values.roktSdkVersionandroktPaymentExtensionVersionto6.0.3so the Rokt SDK and payment extension remain aligned.Testing
trunk check./gradlew build./gradlew test./gradlew ktlintCheckChecklist