Skip to content

fix(sudoku): show failure toast when clearCache delete throws - #690

Merged
wei18 merged 1 commit into
mainfrom
fix/687-clearcache-failure-toast
Jul 5, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/687-clearcache-failure-toast

Conversation

@wei18

@wei18 wei18 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Fixes #687: Sudoku's Clear Cache showed an unconditional 'Cache cleared' success toast even when deleteAbandoned threw. Now mirrors Minesweeper's branching: error → errorReporter funnel + localized 'Couldn't clear cache' failure toast + early return; success toast only on success.

L10n: added the failure key to Sudoku's catalog, all 7 locales byte-identical to MS's existing entry (verified per-locale by CR); L10n fixture regenerated via gen:l10n_fixture; scan:l10n green. New failing-persistence test (deleteAbandonedError scripting on FakePersistence) pins the branch — SudokuKit 262/262, MinesweeperKit 173/173 (untouched). Also refreshes two docs/screen-contracts.md accuracy notes from the audit.

Review: haiku mechanical APPROVE; sonnet reviewer lost to an API outage — Leader completed the semantic pass inline (MS-shape parity, clearCacheConfirmation consumers, and the failure-path resumeCandidate = nil adjudicated acceptable-by-design: the #679 path-shrink refresh restores the pill when Settings pops).

Note for later: the pre-existing SUCCESS literal is unlocalized — tracked as #688 item 6.

🤖 Generated with Claude Code

Sudoku's clearCache() always claimed success even when
persistence.deleteAbandoned threw, unlike Minesweeper's equivalent
which already branches success/failure. Mirror MS's branching:
keep the errorReporter funnel and add a failure-toast path so a
failed clear no longer tells the user it worked.

- SettingsViewModel.clearCache(): on thrown delete, set
  clearCacheConfirmation + show a `.failure` toast instead of
  falling through to the unconditional success toast.
- FakePersistence: add deleteAbandonedError scripting so tests can
  drive the failure branch.
- SettingsViewTests: new
  clearCache_whenDeleteThrows_showsFailureToastNotSuccess case.
- Add "Couldn't clear cache" to Sudoku's Localizable.xcstrings (all
  7 locales, copied byte-identical from Minesweeper's existing
  entry) since Sudoku's catalog didn't carry the key yet.
- docs/screen-contracts.md: CLEAR-CACHE-DIALOG row was already
  app-agnostic (no Sudoku caveat to fix); replace the stale
  "verify naming if reused elsewhere" pauseToggle note with a
  dated repo-wide-grep confirmation of uniqueness.

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18
wei18 merged commit ca21ca9 into main Jul 5, 2026
4 checks passed
@wei18
wei18 deleted the fix/687-clearcache-failure-toast branch July 5, 2026 09:58
wei18 added a commit that referenced this pull request Jul 5, 2026
…ain (#695)

Session log: 4-screenshot bug wave (#673-#677), three-lane dual-app
UIUX/spec audit, navigation-flows + screen-contracts spec (#683), the
screen-contract-spec skill (#684), the contract-driven static pass, the
4-PR fix train (#690-#693), two evidence-based environmental downgrades,
and the gated open items (#685/#468/B1-B4/#694).

Co-authored-by: Claude Fable 5 <[email protected]>
wei18 added a commit that referenced this pull request Jul 27, 2026
…19/N22 (#935) (#949)

Batch 5 (final) of #935's host-driven XCUITest E2E negative-flow coverage.
Adds -uitest-att-primer / -uitest-clear-cache-fail / -uitest-iap-script
DEBUG-only launch-arg seams (GameAppKit) so the ATT primer decline,
clear-cache failure toast, and IAP purchase cancel/fail/pending flows can
be driven deterministically in both apps without real ATT/CloudKit/
StoreKit 2 dependencies. Extracts three construction sites out of
MakeGameApp.swift into MakeGameApp+Helpers.swift /
+UITestOverrides.swift to stay under the 400-line SwiftLint ceiling.

Along the way, N22's investigation surfaced and fixed a real pre-existing
bug: RemoveAdsRow/RestorePurchasesRow used .buttonStyle(.plain) with an
internal Spacer() but no .contentShape(Rectangle()), leaving the row's
middle an untappable dead zone (the swiftui-interaction-footguns "tap
target shrink" pattern) — affects real users tapping the row's center,
not just the E2E driver.

Doc corrections close out N16/N18/N20/N21/N23 per the batch-5 scope
adjudication (issue #935 latest comment): N19's stale "#687 blocked" note
and both stale code anchors are removed (fixed by ca21ca9/#690, unified by
#832); N21's anchor follows the ATT coordinator extraction; N16/N18/N23
get brief unit/launch-smoke-scope closure notes; N20 is marked
documentation-only.

Co-authored-by: Claude Fable 5 <[email protected]>
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.

fix(sudoku): clearCache always shows a success toast even when the delete fails (MS shows failure)

1 participant