Cache backend tags so offline pill filtering stays accurate
Add tags[] to CachedStory (defaulted for lightweight migration) and persist them on upsert; offline StorySummary now carries the cached tags instead of falling back to topic. Backend stays the source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,9 @@ final class CachedStory {
|
||||
var headline: String
|
||||
var summary: String
|
||||
var topic: String
|
||||
/// Canonical backend tags, so offline pill filtering stays accurate.
|
||||
/// Defaulted for lightweight migration of existing cached rows.
|
||||
var tags: [String] = []
|
||||
var signalScore: Int
|
||||
var sourceCount: Int
|
||||
var consensus: String?
|
||||
@@ -182,6 +185,7 @@ final class CachedStory {
|
||||
self.headline = summary.headline
|
||||
self.summary = summary.summary
|
||||
self.topic = summary.topic
|
||||
self.tags = summary.tags ?? []
|
||||
self.signalScore = summary.signalScore
|
||||
self.sourceCount = summary.sourceCount
|
||||
self.consensus = summary.consensus
|
||||
|
||||
Reference in New Issue
Block a user