Skip to content

Fix: Decouple SwiftData cache failures from data loading#245

Open
Crafter-feng wants to merge 2 commits into
supergeorg:mainfrom
Crafter-feng:fix/swiftdata-runtime-cache-fallback
Open

Fix: Decouple SwiftData cache failures from data loading#245
Crafter-feng wants to merge 2 commits into
supergeorg:mainfrom
Crafter-feng:fix/swiftdata-runtime-cache-fallback

Conversation

@Crafter-feng

Copy link
Copy Markdown

Problem

On iOS 26 (and other versions), SwiftData local SQLite store fails to open with NSCocoaErrorDomain Code=256 during runtime fetch operations. API data loads into memory correctly, but the subsequent SwiftData cache sync error propagates and marks the entire data request as failed. Related: #224, #232

Fix

Change all 30 SwiftData operations from try to try? (29 sync* calls + 1 modelContext.fetch). This makes local caching best-effort:

  • SwiftData works: identical behavior
  • SwiftData fails: API data still displays correctly
  • Existing users: zero impact

Changes

  • GrocyViewModel.swift: 30 try -> try?
  • build.yml: GitHub Actions workflow for automated builds

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.

1 participant