Repository navigation
fix(daily-hub): render trio immediately, fill completion async (#526) - #528
Merged
Merged
Conversation
When iCloud is signed out, the CloudKit completed-daily-ids fetch hangs indefinitely instead of throwing — the previous `async let completedCall` pattern blocked bootstrap() at `try await completedCall` forever, leaving the Sudoku Daily Hub in .loading with a permanent spinner (no cards). Two-phase fix, mirroring MinesweeperDailyHubViewModel: 1. Fetch the trio (pure-local) and immediately set state = .loaded(cards) with every card un-completed — the hub renders without gating on any account. 2. fillCompletionOverlay(trio:date:) runs afterwards; a hang or error there degrades silently (cards stay un-completed) instead of blocking the hub. Tests: bootstrapReachesLoadedEvenWhenCompletedIdsFetchHangsForever (HangingPersistence reproduces the CK hang) + the iCloud-signed-out throw degrade path. 244/244 SudokuKit pass. Fixes #526. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ngth (#526) DailyHubViewModelInteractionTests hit 422 lines (SwiftLint file_length 400). Moved the two #526 offline regression tests + their HangingPersistence / ThrowingCompletionPersistence fakes into DailyHubViewModelOfflineTests.swift (own @suite). swiftlint --strict clean; SudokuKit 244/244 pass. 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.
Fixes #526 — Sudoku Daily Hub spun forever when iCloud is signed out.
Root cause
bootstrap()didasync let completedCall = persistence.fetchCompletedDailyIds(...)thentry await completedCall. With iCloud signed out the CloudKit completed-ids fetch hangs indefinitely (it never throws), so bootstrap stayed in.loading→ permanent spinner, no cards.Fix (two-phase, mirrors the intended MinesweeperDailyHub shape)
state = .loaded(cards)immediately, all un-completed — the hub renders without gating on any account.fillCompletionOverlayruns after, best-effort; a hang/error degrades silently (cards stay un-completed).Verification
swift test --package-path Packages/SudokuKitgreen (244 macOS / 279 iOS-runner). New tests:bootstrapReachesLoadedEvenWhenCompletedIdsFetchHangsForever(HangingPersistence — fails against old code) + the iCloud-signed-out throw degrade path. Leader will also sim-verify offline Daily Hub render post-merge.Review (dual-model CR)
Sonnet: PASS (completion accuracy correct, hang test non-vacuous, tap-during-fill benign, MainActor-safe, CK lazy). Haiku: flagged the same MS mirror gap as a blocker. Leader adjudication: the Sudoku fix is sound and both reviewers PASS it; the MS DailyHub still uses the single-phase pattern, but it is latent (sim shows MS Daily Hub renders offline today) — tracked as a follow-up (bundled with #515, MS iCloud-gate family), including Sonnet's defensive
guard case .loadednit. Not a blocker for the actually-broken Sudoku surface.🤖 Generated with Claude Code