feat(feeds): expose retained operation history and read-only rechecks
Build and publish container images / images (push) Successful in 11m14s

This commit is contained in:
Anya Tokugawa committed 2026-11-08 06:35:53 +09:00
1 parent e4c184d71c
commit 1057be6d2b
12 files changed
+547 -10

No files matched your search

+23 -1
View File
@@ -591,6 +591,28 @@ func TestFeedsChromium(t *testing.T) {
w.WriteHeader(204)
return
}
if r.URL.Path == "/fixture/feed-history" && r.Method == "POST" {
missing, orphan := uuid.NewString(), uuid.NewString()
for _, entry := range []struct{ request, source, item string }{{missing, fresh.UUID, "history-evicted"}, {orphan, uuid.NewString(), `<img src=x onerror=alert(1)>`}} {
if _, e := s.store.DB.Exec(`INSERT INTO feed_actions(domain_uuid,owner_uuid,request_id,source_uuid,item_id,field,desired,source_version,status,created_ms) VALUES(?,?,?,?,?,'read',1,1,'unknown',?)`, domain, actor, entry.request, entry.source, entry.item, time.Now().UnixMilli()); e != nil {
t.Error(e)
http.Error(w, "fixture insert failed", 500)
return
}
}
writeEventJSON(w, 200, map[string]string{"missing": missing, "orphan": orphan})
return
}
if r.URL.Path == "/fixture/check-feed-history" && r.Method == "POST" {
fake := &feedRemoteFake{id: "history-evicted", read: true}
if e := s.syncFeedActions(r.Context(), fake.client(t)); e != nil || fake.edits != 0 {
t.Errorf("history read-only check: %v edits=%d", e, fake.edits)
http.Error(w, "test recheck failed", 500)
return
}
w.WriteHeader(204)
return
}
if r.URL.Path == "/fixture" {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
fmt.Fprint(w, "<!doctype html><body style='margin:0'><script>"+string(script)+"</script></body>")
@@ -600,7 +622,7 @@ func TestFeedsChromium(t *testing.T) {
}))
defer web.Close()
for _, width := range []string{"1440", "390"} {
if _, e = s.store.DB.Exec(`DELETE FROM feed_actions WHERE source_uuid=?`, fresh.UUID); e != nil {
if _, e = s.store.DB.Exec(`DELETE FROM feed_actions`); e != nil {
t.Fatal(e)
}
if _, e = s.store.DB.Exec(`UPDATE feed_items SET is_read=0 WHERE source_uuid=?`, fresh.UUID); e != nil {