Deliver per (inbox, domain) — federation actor gets all posts too

Add app_domain to APDeliveryLog so the same activity can be delivered
to the same inbox under different actor identities (blog + federation).
This commit is contained in:
giles
2026-02-23 21:51:19 +00:00
parent 61ad2db2f3
commit d9b51b1f84
3 changed files with 55 additions and 22 deletions

View File

@@ -454,12 +454,13 @@ class APDeliveryLog(Base):
Integer, ForeignKey("ap_activities.id", ondelete="CASCADE"), nullable=False,
)
inbox_url: Mapped[str] = mapped_column(String(512), nullable=False)
app_domain: Mapped[str] = mapped_column(String(128), nullable=False, server_default="federation")
status_code: Mapped[int | None] = mapped_column(Integer, nullable=True)
delivered_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), nullable=False, server_default=func.now(),
)
__table_args__ = (
UniqueConstraint("activity_id", "inbox_url", name="uq_delivery_activity_inbox"),
UniqueConstraint("activity_id", "inbox_url", "app_domain", name="uq_delivery_activity_inbox_domain"),
Index("ix_ap_delivery_activity", "activity_id"),
)