Repository navigation
fix(minesweeper): graceful offline degrade for Daily Hub + resume (#530 #515) - #532
Merged
Merged
Conversation
Bootstrap now sets `state = .loaded(mergeCards(trio, [], []))` immediately after the synchronous `provider.dailyTrio(date:)`, then fills completion and failure overlays async in `fillCompletionAndFailureOverlay` (Phase 2). A CloudKit hang (iCloud signed out) can no longer block the hub's initial render — same gate class and fix shape as the shipped Sudoku fix (#526). Added `guard case .loaded = state else { return }` defensive check at Phase-2 entry and exit (Sonnet's #526 nit, now applied to MS too). New test file `MinesweeperDailyHubViewModelOfflineTests.swift` adds three tests mirroring `DailyHubViewModelOfflineTests`: - `bootstrapReachesLoadedEvenWhenCompletedIdsFetchHangsForever` - `bootstrapReachesLoadedWhenCompletedIdsFetchThrowsImmediately` - `bootstrapMarksCompletedCardsWhenPersistenceReturnsIds` (happy-path guard) Package.swift: added SudokuCoreKit as explicit dep of MinesweeperUITests so offline-hub fakes can implement PersistenceProtocol (which uses Mode/GameSessionSnapshot from SudokuCoreKit) under InternalImportsByDefault. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…eStore (#515) `loadInProgress(recordName:)` and `latestInProgress()` now catch errors classified as `.iCloudSignedOut` (CKError.notAuthenticated code 9, and `PersistenceError.iCloudNotSignedIn`) and return `nil` instead of throwing. This degrades the Home resume pill / resume flow gracefully when iCloud is signed out, rather than dead-ending with a thrown error. Schema and decode errors are NOT caught — `PersistenceError.schemaVersionTooNew` and JSON decode failures still propagate, preserving the #463 contract that lets callers hide or delete a broken candidate. New tests in `MinesweeperSavedGameStoreTests.swift`: - `loadInProgressReturnsNilOnICloudSignedOutError` — fetch throws CKError 9 -> nil - `latestInProgressReturnsNilOnICloudSignedOutError` — query throws CKError 9 -> nil - `loadInProgressStillThrowsOnSchemaVersionTooNew` — regression guard for #463 - `loadInProgressStillThrowsOnDecodeError` — regression guard for #463 Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Jun 16, 2026
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.
Two Minesweeper iCloud-signed-out bugs, same gate family as #512/#526.
#530 — MS Daily Hub two-phase render
MinesweeperDailyHubViewModel.bootstrap()now renders the (local, synchronous) trio immediately (state = .loaded), then fills completed+failed overlays async/best-effort (guard case .loaded+ per-fetch catch). Mirrors the shipped Sudoku #526 fix, so a hanging CloudKit fetch can't block the hub.#515 — MS resume degrades offline
MinesweeperSavedGameStore.loadInProgress/latestInProgressnow map an iCloud-signed-out fetch (UserFacingError.classify == .iCloudSignedOut) tonil(no resumable game) instead of throwing — the Home resume pill degrades gracefully offline. Schema-too-new + decode errors still propagate (the #463 contract) since they occur after the fetch, outside the catch.Verification
swiftlint --strict clean (5 files); MinesweeperKit 179/179 (--no-parallel). New tests: hang-repro + fast-fail + happy-path (#530); notAuth→nil ×2 + schema-still-throws + decode-still-throws regression guards (#515).
Leader sim-verified (iPhone 17 Pro, no iCloud): MS Daily Hub renders 3 cards offline (Beginner/Intermediate/Expert, —).
Review
Sonnet CR: PASS — #515 classification correct (only iCloudSignedOut→nil; schema/decode rethrow; tests non-vacuous), #530 two-phase correct + hang test would fail pre-fix, Package.swift SudokuCoreKit dep is test-target-only (already transitive). No blocking findings.
🤖 Generated with Claude Code