Repository navigation
fix(minesweeper): run persistence.bootstrap() so AdGate/banner works (#448) - #450
Merged
Merged
Conversation
…448) MinesweeperRootViewModel skipped persistence.bootstrap() (which Sudoku's RootViewModel runs), so the CloudKit user zone was never provisioned. As a result AdGate's LiveMonetizationStateStore.loadState() threw when seeding the first-launch record, AdGate.shouldShowBanner() hit its conservative `catch { return false }`, and the Minesweeper Home banner never appeared. Mirror SudokuUI.RootViewModel: hold `persistence: any PersistenceProtocol` and call `try await persistence.bootstrap()` in a do/catch (funneled through ErrorReporter, source "MinesweeperRootViewModel.bootstrap.persistence") BEFORE the Game Center auth block. Bootstrap is idempotent + non-blocking so a failure does not block GC auth or Root. Out of scope (issue #448 item ①): resume-candidate / latestInProgress() — not copied. Co-Authored-By: Claude Opus 4.8 <[email protected]>
wei18
enabled auto-merge (squash)
June 9, 2026 10:26
…ength (#448) CI lint:swift_strict treats file_length warning as error; the +2 call-site lines tipped Live.swift to 403 (>400). Drop 4 redundant comment lines (PR-number parentheticals + one wrapped clause) — no factual loss; PR refs remain in git history. Co-Authored-By: Claude Opus 4.8 <[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.
Problem (#448 item ②)
The Minesweeper Home banner never appears. Root cause chain:
MinesweeperRootViewModelskippedpersistence.bootstrap()(which Sudoku'sRootViewModelruns).AdGate'sLiveMonetizationStateStore.loadState()throws when it tries to seed the first-launch record.AdGate.shouldShowBanner()hits its conservativecatch { return false }and suppresses the banner.Fix
Surgical parity change — give Minesweeper the same persistence-bootstrap that
SudokuUI.RootViewModelalready has:MinesweeperRootViewModelnow holdspersistence: any PersistenceProtocoland, inbootstrap(), callstry await persistence.bootstrap()inside a do/catch that funnels failures throughErrorReporter(source: "MinesweeperRootViewModel.bootstrap.persistence"), before the existing Game Centerauthenticate()block. Bootstrap is idempotent + non-blocking, so a transient failure (e.g. no iCloud account) retries next launch and does not block GC auth or Root — mirrorsRootViewModel.bootstrap.persistenceexactly.MinesweeperRootViewModel(construction sites inMinesweeperAppComposition/Live.swift(.live()+.preview()) now passpersistence:(already in scope).Out of scope
Resume-candidate /
latestInProgress()/ ResumePill is issue #448 item ① (a separate feature) and is intentionally NOT copied here.Verification
swift build --package-path Packages/MinesweeperKit— succeeds.swift test --package-path Packages/MinesweeperKit— 127 tests pass.swift test --package-path Packages/MinesweeperCoreKit— 81 tests pass.Refs #448
🤖 Generated with Claude Code