Skip to content

chore(monetization): delete the write-only ad-status cache left after #922 - #926

Merged
wei18 merged 1 commit into
mainfrom
chore/757w6-remove-writeonly-ad-status-cache
Jul 21, 2026
Merged

wei18 merged 1 commit into
mainfrom
chore/757w6-remove-writeonly-ad-status-cache

Conversation

@wei18

@wei18 wei18 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

What

Removes the write-only ad-status cache orphaned when #922 deleted currentBannerStatus() (its only reader): LiveAdMobBridge's status-only OSAllocatedUnfairLock<AdBannerStatus> + setCachedStatus + 3 call sites, and FakeAdMobBridge.cachedStatus + setCachedStatus + 2 call sites.

Why

#757 wave-6 follow-on to #922 — dead-code tail flagged by that PR's CR.

Verification

  • Per-symbol grep: zero readers before deletion. Surgical — Live's deleted lock held only the status; the Fake's state lock SURVIVES (guards other still-read fields, only cachedStatus removed); liveBanners/inFlightDelegates untouched.
  • Behavior-inert: LiveAdMobAdProvider uses its own lastKnownStatus, never read the bridge cache.
  • AppMonetizationKit build clean + 120 tests pass; swiftlint --strict clean.
  • Dual CR: APPROVE ×2 (surgical scope confirmed both bridges).

Part of #757

🤖 Generated with Claude Code

…922

#757 wave-6 follow-on to #922. Removing AdMobBridge.currentBannerStatus()
(#922) deleted the ONLY reader of an internal ad-status cache, leaving it
write-only. This removes that dead tail:
- LiveAdMobBridge: the status-only OSAllocatedUnfairLock<AdBannerStatus> +
  setCachedStatus + its 3 call sites (start/loadBanner success+failure).
- FakeAdMobBridge: the cachedStatus field + setCachedStatus + its 2 call sites.

Surgical: the deleted Live lock held ONLY the status; liveBanners /
inFlightDelegates / per-load delegate locks are untouched. The Fake's state
lock SURVIVES (only its cachedStatus sub-field removed — it still guards
startError/loadError/nextHandle/callCounts/disposedHandles, all still read).
Behavior-inert: LiveAdMobAdProvider tracks status via its own lastKnownStatus,
never read the bridge cache. A test whose name referenced the deleted cache
was renamed + its comment corrected (orphan cleanup).

Per-symbol grep confirmed zero readers before deletion. Verified:
AppMonetizationKit build clean + 120 tests pass; swiftlint --strict clean.
Dual CR: APPROVE x2 (surgical scope confirmed on both bridges; one optional
cosmetic on a merged comment block, left as coherent).

Part of #757

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18
wei18 enabled auto-merge (squash) July 21, 2026 06:20
@wei18
wei18 merged commit ecc0e29 into main Jul 21, 2026
5 checks passed
@wei18
wei18 deleted the chore/757w6-remove-writeonly-ad-status-cache branch July 21, 2026 06:21
@wei18 wei18 mentioned this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant