From 4b69ba22fc471ebb1bf625a519511aa42e721e85 Mon Sep 17 00:00:00 2001 From: yoma Date: Sat, 4 Jul 2026 20:26:13 +0800 Subject: [PATCH] fix(cron): mark live deliveries as final notifications --- cron/scheduler.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cron/scheduler.py b/cron/scheduler.py index 964cee4916..52ab85f76a 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -3519,10 +3519,14 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option route_metadata = { "direct_messages_topic_id": str(thread_id), "job_id": job["id"], + "notify": True, } # Media metadata mirrors the text routing so attachments land in # the same DM topic instead of the General lane (#22773). - media_metadata = {"direct_messages_topic_id": str(thread_id)} + media_metadata = { + "direct_messages_topic_id": str(thread_id), + "notify": True, + } else: # Forum-style topic (private chat / supergroup) or non-topic # target: route via message_thread_id (#52060). Put thread_id in @@ -3533,10 +3537,12 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option # anchor, so the metadata key bypasses that check and lets the # adapter route via a plain message_thread_id. route_thread_id = str(thread_id) if thread_id is not None else None - route_metadata = {"job_id": job["id"]} + route_metadata = {"job_id": job["id"], "notify": True} if route_thread_id: route_metadata["thread_id"] = route_thread_id - media_metadata = {"thread_id": thread_id} if thread_id else None + media_metadata = {"notify": True} + if thread_id: + media_metadata["thread_id"] = thread_id # Relay egress needs a tenant discriminator on the frame: the # connector's fail-closed guard resolves the workspace/guild from