feat: sync read/unread state to backend with persistent device ID
- APIClient: generate and persist a stable device UUID (jarvis.device.id in UserDefaults); attach as X-Jarvis-Device-Id header on every request - Add markStoryRead / markStoryUnread — POST/DELETE /stories/:id/read with device_id, read_at, and source fields - Wire both calls into all three read-toggle sites: SignalFeedView, ArticleReaderView, StoryDetailView - Add postVoid helper for fire-and-forget POST calls (no response body needed) - Pass include_read param on stories fetch for future server-side filtering - CacheMaintenance: recentHours 84→72 (mirrors backend 72h story window); markerHours 96→192 so read suppression survives a full weekly news cycle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,8 @@ enum CacheMaintenance {
|
||||
private static let hour: TimeInterval = 3_600
|
||||
private static let day: TimeInterval = 86_400
|
||||
|
||||
private static let recentHours = 84.0 // 3.5 days: survives weekends
|
||||
private static let markerHours = 96.0 // 4 days: active window + buffer
|
||||
private static let recentHours = 72.0 // 3 days: mirrors backend active story window
|
||||
private static let markerHours = 192.0 // 8 days: read suppression survives weekly repeats
|
||||
private static let articleDays = 14.0 // cached article bodies (backend article retention)
|
||||
|
||||
/// Age-based eviction. Run on launch. Cheap; protects saved stories.
|
||||
|
||||
Reference in New Issue
Block a user