refactor(admob): share suspended ad load result tracking - #4053
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next-gen-admob-sdk #4053 +/- ##
===================================================
Coverage 82.99% 82.99%
===================================================
Files 437 437
Lines 17893 17893
Branches 2684 2684
===================================================
Hits 14851 14851
Misses 2148 2148
Partials 894 894 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlvaroBrey
approved these changes
Aug 24, 2026
3 tasks
polmiro
added a commit
that referenced
this pull request
Aug 26, 2026
…4086) ## Summary I jumped the gun and merged the approved PR for interstitial ads before adopting the new helper. - #4053 introduced the shared `AdLoadResult.trackAndConfigureAdLoadResult` foundation helper. - Adopt that helper at the existing suspending interstitial load call site while preserving result identity, tracking order, and callback installation. ## Test plan - [x] `./gradlew :feature:admob-next-gen:testDefaultsDebugUnitTest` - [x] `./gradlew detektAll` - [x] `./scripts/api-check.sh` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mechanical refactor to a shared helper with equivalent tracking and callback wiring; no API or auth changes. > > **Overview** > The suspending **`AdTracker.loadAndTrackInterstitialAd`** path no longer inlines success/failure tracking with **`trackAdLoaded`** / **`trackAdFailedToLoad`**. It now chains **`InterstitialAd.load`** through the shared **`trackAndConfigureAdLoadResult`** helper (from #4053), passing interstitial format metadata and a **`configureAd`** block that installs the tracking event callback. > > Behavior is intended to stay the same: the original **`AdLoadResult`** is returned, load success/failure events are still tracked, and tracking is installed on successful loads before the suspend function completes. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9a4b7f0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Summary
Context
This is a foundation-only change for later adoption by the format-specific suspending loaders.
Test plan
Note
Low Risk
Internal tracking helper plus unit tests; no public API or production call-site changes yet.
Overview
Adds
AdLoadResult.trackAndConfigureAdLoadResultso suspending Next-Gen loaders can reuse the same loaded/failed tracking asTrackingAdLoadCallback.On success it tracks then runs
configureAd; on failure it only tracks. It always returns the original result instance, and tracking still goes throughtrackIfConfiguredso missing SDK setup or tracker errors do not skip ad configuration. Unit tests cover success, failure, and those resilience cases.Reviewed by Cursor Bugbot for commit 1690bc2. Bugbot is set up for automated code reviews on this repo. Configure here.