Repository navigation
fix(v2): LiveAdMobBridge.loadBanner throws until real SDK wiring lands - #73
Merged
Merged
Conversation
Audit Blocker B1 (2026-05-21): the v2.2 stub synthesized .loaded(handle) without invoking the SDK — UI would believe a creative was fetched when nothing happened. Replace with a visible failure: setCachedStatus(.failed) + throw AdMobBridgeError.loadFailed. Banner UI in v2.3.5 will show the failed state until the real GADBannerView + Request + delegate land. Test verification: BannerLoadTests 8/8 pass — the suite exercises the bridge through FakeAdMobBridge, so the live bridge change is contract- compatible. Real-SDK wiring deferred to v2.3.5. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This was referenced May 21, 2026
wei18
added a commit
that referenced
this pull request
May 22, 2026
Address all 5 Medium + 6 Nit findings from 2026-05-21 Code Reviewer audit (B1 + B2 already merged in #73 + #71). Code Reviewer approved 2026-05-22 after one revision (test fix for M5 false-positive). M1 — design ↔ code reconciliation - docs/v2/design.md §How.3 removed misleading lastShownDate gating rule; clarified lastShownDate is recorded for telemetry only (matches code) M2 — onPersistenceError closure - AdGate.init(store:calendar:onPersistenceError:) — new optional closure parameter; MonetizationCore stays Telemetry-free, host wires the route - Live wiring in SudokuKit/AppComposition/Live.swift fan-outs to Telemetry - AdGate.mutate(_:) catch now invokes the closure (was a comment) - Test: saveFailureSurfacesViaOnPersistenceError M3 — empty displayPrice + catalog-desync telemetry - LiveStoreKit2IAPClient: empty fallback now "—" (em-dash placeholder) - New optional onCatalogDesync closure → Telemetry.errorOccurred M4 — timezone-shift test - AdGateLogicTests.dismissedTodayAcrossDateLineCrossing M5 — system-clock-manipulation defense - AdGateState.lastSeenWallClock: Date? (new optional field) - AdGate.clockTamperTolerance = 24h - shouldShowBanner refuses grace if now < lastSeen - tolerance - Monotonic advance on show/dismiss/purchase paths - LiveMonetizationStateStore CloudKit field add-via-write - Tests: clockMovedBackwardsRefusesGraceAdvance (firstLaunch 2024-01-01), clockToleranceWithin24hStillShows (verified by flip-guard technique per Code Reviewer reject + revision) N1 — AdPresentationAnchor narrowed AnyHashable → UUID; drop @unchecked N2 — actor-vs-class re-eval deferred to post-v2.3.5 (noted) N3 — AdPresentationAnchor resolver split into separate file (Foundation- only type vs UIKit/AppKit resolvers); enables future Linux exclude N4 — LiveStoreKitBridge.transactionUpdates priority .background → .utility N5 — FakeIAPClient single-consumer constraint — diagnostic tracking (purchaseUpdatesWasSubscribed) instead of crashing tests N6 — ProtocolShapeTests.valueTypesRemainSendable compile-time Sendable coverage on AdGateState, IAPProduct, IAPPurchaseEvent variants, IAPPurchaseResult, AdBannerStatus, AdPresentationAnchor Public surface stable: only optional init params + optional struct field + resolver file split. No SemVer-breaking additions. Verification: - AppMonetizationKit: 87/87 tests (was 82, +5) - SudokuKit affected suites: 28/28 (HomeViewBanner saveCount assertion relaxed from == 1 → >= 1 per new wall-clock advance semantics) - swift build clean both packages - Isolation audit: 1 GoogleMobileAds import (LiveAdMobBridge.swift) §未決 (impl-notes) - M5 wall-clock advance writes on every shouldShowBanner — acceptable for v2; throttle in v2.x if CloudKit quota matters - N5 Fake vs Live multi-subscriber semantics differ (diagnostic-only) - AdPresentationAnchorRegistry still v2.2 backlog Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18
added a commit
that referenced
this pull request
Sep 12, 2026
…k round) (#1069) Brings in the phase-2 body improvements and references/ splits (#73–#78), the final-check review fixes across all four scopes (#79–#82), and the gate hardening: fails on MAJOR, warns when the description listing exceeds the default budget, README mirrors are manual-only. Pointer-only. Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Audit Blocker B1 fix —
LiveAdMobBridge.loadBanner()previously synthesized.loaded(handle)without calling the SDK. Replaced with a visible failure (AdMobBridgeError.loadFailed+ cached.failedstatus) so the UI cannot pretend a creative was fetched.Real SDK wiring lands in v2.3.5 alongside
BannerSlotView.Verification
Reference
meetings/2026-05-21_appmonetizationkit-code-audit.impl-notes.mdBlocker B1.