fix: notify callers when a Rokt placement cannot be requested - #814
Conversation
PR SummaryLow Risk Overview Existing kit forwarding and warning logs are unchanged. Unit tests cover both entry points plus nil- Reviewed by Cursor Bugbot for commit 28e0bd4. Bugbot is set up for automated code reviews on this repo. Configure here. |
aedede1 to
3ac1f6e
Compare
📦 SDK Size Impact ReportMeasures how much the SDK adds to an app's size (with-SDK minus without-SDK).
➡️ SDK size impact change is minimal. Raw measurementsTarget branch (main): {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1920,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1836,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6648}This PR: {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1920,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1836,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6648} |
BrandonStalnaker
left a comment
There was a problem hiding this comment.
solid improvement
selectPlacements and selectShoppableAds returned without invoking the caller's onEvent handler when the Rokt kit configuration had not been applied, leaving partners waiting on a callback that never arrived. Deliver RoktPlacementFailure on the main queue in that case, matching the event the Rokt SDK emits when a placement cannot be displayed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3ac1f6e to
28e0bd4
Compare
Background
MPRokt.selectPlacements:attributes:embeddedViews:config:onEvent:resolves the dashboard attribute mapping viagetRoktPlacementAttributesMappingbefore forwarding to the Rokt kit. That method returnsnilwhenever the Rokt kit configuration is not present inMPKitContainer.originalConfig— most commonly because remote configuration has not been applied yet, and also when the kit is not enabled for the workspace.onEventhandler was never invoked, so partners waiting on a placement lifecycle event (loading indicator, spinner, checkout continuation) were left waiting on a callback that would never arrive, with nothing to distinguish "not configured" from "still loading".MPRokt.selectShoppableAds:attributes:config:onEvent:had the same behaviour on the same code path.What Has Changed
selectPlacementsandselectShoppableAdsnow deliverRoktEvent.PlacementFailure(RoktPlacementFailure, carrying the requested placement identifier) to the caller'sonEventhandler when the Rokt kit configuration is unavailable. The existing warning log is unchanged.onEventisnil(including the convenienceselectPlacements:attributes:overload).RoktPlacementFailureis the event the Rokt SDK already emits when a placement cannot be displayed, so partner event handlers need no new cases.onEventregression test, and a CHANGELOG entry.Scope
MPKitContainer.forwardSDKCalldiscards a forwarded call when the Rokt kit is registered and configured but has not finished starting, since the kit only setsstartedfrom the asynchronousRokt.initcallback.Checklist
Additional Notes
RoktPlacementFailure. This is additive, but it is the first time this code path emits an event at all, so it is worth calling out in release notes.Reference Issue (For employees only. Ignore if you are an outside contributor)