fb_posts: past its publish time, a scheduled post reads as published

Facebook does not call back and the reconciliation was never built, so a
row that stayed scheduled forever was a lie of omission. Decided by Mike:
once the time passes with nothing else reported, the post is published.
status keeps what the publisher last said; state is what a reader acts
on, and the open-only list and cancel use state. Cancel on a post whose
time has passed says so.
This commit is contained in:
2026-09-04 19:53:08 -04:00
parent 55e4c67b9a
commit ea22ed53e7
3 changed files with 36 additions and 8 deletions
+3 -2
View File
@@ -1025,8 +1025,9 @@ def cancel_fb_post(request: Request, pid: str, x_admin_token: str = Header(None)
rec = store.get_fb_post(pid)
if not rec:
raise HTTPException(404, "no such post")
if rec["status"] not in ("scheduled",):
raise HTTPException(409, "post is %s, not scheduled" % rec["status"])
if rec["state"] != "scheduled":
raise HTTPException(409, "post is %s, not scheduled" % rec["state"]
+ (" (its publish time has passed)" if rec["status"] == "scheduled" else ""))
if not rec.get("cancel_url"):
raise HTTPException(409, "no cancel link was recorded for this post")
import urllib.request as _ur, urllib.error as _ue