feat(bg): add background feed refresh every ~30 min
Some checks failed
CI / Build · macos-14 · Debug (push) Has been cancelled
CI / Build · macos-15 · Debug (push) Has been cancelled
CI / Build · macos-14 · Release (push) Has been cancelled
CI / Build · macos-15 · Release (push) Has been cancelled

Registers com.kisani.jarvis.feed.refresh as a BGAppRefreshTask.
On each fire it fetches the latest 40 stories and upserts CachedStory
rows so the SwiftData cache is warm before the user opens the app.
Already-cached rows have signalScore / sourceCount refreshed in-place.

Single ModelContainer owned by JarvisApp and shared via
BackgroundRefreshManager.container to avoid multi-container conflicts.
BG task ID registered in AppDelegate and declared in project.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Robin Kutesa
2026-06-21 01:42:20 +03:00
parent 7085a4dd45
commit 3b09fa2889
3 changed files with 98 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ targets:
- processing
BGTaskSchedulerPermittedIdentifiers:
- com.kisani.jarvis.briefing.refresh
- com.kisani.jarvis.feed.refresh
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.kisani.jarvis