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

+11
View File
@@ -263,6 +263,17 @@ func (s *Store) SaveFeedSource(ctx context.Context, domain, owner string, v Feed
if !errors.Is(lookup, sql.ErrNoRows) {
return lookup
}
// Do not rebind retained receipts to a different remote identity.
// Both predicates use existing indexes: owner history and the global
// partial index of unresolved operations. Other owners' terminal
// receipts remain isolated by domain/owner in metadata lookups.
var retired bool
if e := tx.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM feed_actions WHERE domain_uuid=? AND owner_uuid=? AND source_uuid=?) OR EXISTS(SELECT 1 FROM feed_actions WHERE source_uuid=? AND status IN ('queued','preparing','sending','unknown','check_queued','checking'))`, domain, owner, v.UUID, v.UUID).Scan(&retired); e != nil {
return e
}
if retired {
return ErrTaskConflict
}
var n int
if e := tx.QueryRowContext(ctx, `SELECT count(*) FROM feed_sources WHERE domain_uuid=? AND owner_uuid=?`, domain, owner).Scan(&n); e != nil {
return e