aboutsummaryrefslogtreecommitdiff
path: root/.ai
diff options
context:
space:
mode:
Diffstat (limited to '.ai')
-rw-r--r--.ai/workflows/triage-intake.telegram.org26
1 files changed, 23 insertions, 3 deletions
diff --git a/.ai/workflows/triage-intake.telegram.org b/.ai/workflows/triage-intake.telegram.org
index 1319da5..6ec9d66 100644
--- a/.ai/workflows/triage-intake.telegram.org
+++ b/.ai/workflows/triage-intake.telegram.org
@@ -50,8 +50,10 @@ server never disables the source.
The setq is mandatory defense: tdlib crashed in native mode when this was
set up (2026-06-09) — a separate matter from the SEGFAULT gotcha, which is
about the loadChats argument — and Craig's daemon defaults to nil.
- Wait ~2s for Ready, then (telega--loadChats '(:@type "chatListMain")) until telega--chats
- is populated.
+ Wait ~2s for Ready, then (telega--loadChats '(:@type "chatListMain") #'ignore)
+ until telega--chats is populated. The #'ignore callback is mandatory, not
+ decoration: without it every call prints a spurious "Telega error 404" (see
+ Step 1's comment).
3. Check messages: the maphash unread scan in ** Scan Step 2 (filters the
messageContactRegistered join-notice noise).
4. Send (needs the server live; /voice personal first — Telegram
@@ -135,7 +137,25 @@ emacsclient -e "(progn
# The `fboundp' guard matches Step 0: if the launch failed outright telega is not
# loaded, and that should read as 'server-died like any other failure rather than
# signalling void-function.
-emacsclient -e "(progn (ignore-errors (telega--loadChats '(:@type \"chatListMain\"))) (ignore-errors (telega--loadChats '(:@type \"chatListMain\"))) (if (and (fboundp 'telega-server-live-p) (telega-server-live-p)) 'loaded 'server-died))"
+#
+# The `#'ignore' callback is what keeps this quiet, and it is a THIRD separate
+# concern from the two above — it touches the callback, not the argument and not
+# docker mode. Without it each call printed `Telega error 404: Not Found' into the
+# echo area and *Messages* of Craig's daemon, two lines per scan from whichever
+# project ran it. The 404 is TDLib's end-of-list marker ("Return error if all chats are
+# loaded"), not a fault: `telega--loadChats' hands the callback to
+# `telega-server--send-or-call', which sends fire-and-forget when it is nil, so the
+# reply matches no `:@extra', falls through to `telega--on-error' — a bare catch-all
+# whose whole body is that message — and gets printed. telega's own startup call
+# (telega.el:290) passes a callback and is silent for exactly this reason.
+# Passing a callback keeps the call asynchronous: the block-and-wait path in
+# `telega-server--call' is reachable only when the callback is nil.
+#
+# The macro's docstring reads "Use this macro instead of `(or callback 'ignore)'
+# pattern." That is guidance for whoever writes a tdlib wrapper — don't hardcode a
+# callback inside the wrapper — not a bar on the caller choosing one. We are the
+# caller.
+emacsclient -e "(progn (ignore-errors (telega--loadChats '(:@type \"chatListMain\") #'ignore)) (ignore-errors (telega--loadChats '(:@type \"chatListMain\") #'ignore)) (if (and (fboundp 'telega-server-live-p) (telega-server-live-p)) 'loaded 'server-died))"
#+end_src
On a persisted session telega reaches status "Ready" within ~2s; the chat list