summaryrefslogtreecommitdiff
path: root/services/worker/internal/fetcher
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 00:49:03 -0800
committerFuwn <[email protected]>2026-02-12 00:49:42 -0800
commit2911927a2d9fdd5616c2eda5643143f601068888 (patch)
tree79726e2f2babc4a1da58c30b59d22981fbbdfe26 /services/worker/internal/fetcher
parentRedump latest Supabase schema (diff)
downloadasa.news-2911927a2d9fdd5616c2eda5643143f601068888.tar.xz
asa.news-2911927a2d9fdd5616c2eda5643143f601068888.zip
fix: prevent read entries from reverting to unread on re-fetch
Root cause: cleanup_stale_entries deleted read-but-unsaved entries from active feeds, then the Go worker re-inserted them with new UUIDs, orphaning the user_entry_states rows and making entries appear unread. - cleanup_stale_entries: skip feeds with active subscribers and preserve entries that have been read (not just saved) - Go parser: normalize GUIDs by trimming whitespace and stripping tracking query parameters from URL-based identifiers - Go writer: preserve original published_at on upsert instead of overwriting, preventing old entries from jumping to timeline top - get_unread_counts: apply same time boundary as get_timeline so ancient re-inserted entries don't inflate counts - Realtime listener: ignore INSERT events for entries older than 48h to suppress misleading "new entries" notifications from re-inserts
Diffstat (limited to 'services/worker/internal/fetcher')
-rw-r--r--services/worker/internal/fetcher/errors_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/worker/internal/fetcher/errors_test.go b/services/worker/internal/fetcher/errors_test.go
index e81251b..5c425aa 100644
--- a/services/worker/internal/fetcher/errors_test.go
+++ b/services/worker/internal/fetcher/errors_test.go
@@ -107,7 +107,9 @@ func TestClassifyTimeoutError(test *testing.T) {
type timeoutErr struct{}
func (timeoutError *timeoutErr) Error() string { return "connection timed out" }
+
func (timeoutError *timeoutErr) Timeout() bool { return true }
+
func (timeoutError *timeoutErr) Temporary() bool { return true }
func TestClassifyNetworkOpError(test *testing.T) {