Commit67862220Recorded30 Jun 2026Repositorysigil-telegram

Bump sigil-telegram to 0.10.5: surface delivered-but-ack-unconfirmed

Message

Relock onto sigil-http 0.16.6. tg-api-call now catches sigil-http's 'http-ack-unconfirmed (request written, response read failed → likely delivered) and re-raises a tg-level 'tg-ack-unconfirmed, so callers can treat it as best-effort success instead of retrying (which would re-deliver). A genuine never-sent failure still surfaces as the existing 'HTTP request failed' error. Exports tg-ack-unconfirmed?.

Changed
 package.sgl                   |  2 +-
 sigil.lock                    |  4 ++--
 src/sigil/telegram/client.sgl | 27 ++++++++++++++++++++++++---
 3 files changed, 27 insertions(+), 6 deletions(-)
Diff
package.sglmodified
@@ -6,7 +6,7 @@
6
7
(package
8
name: "sigil-telegram"
9
version: "0.10.4"
+9
version: "0.10.5"
10
sigil: "^0.17"
11
description: "Telegram Bot API client library"
12
url: "https://codeberg.org/sigil/sigil-telegram"
sigil.lockmodified
@@ -14,8 +14,8 @@
14
(package name: "sigil-http"
15
url: "codeberg:sigil/sigil-http"
16
ref: "^0.16.0"
17
sha: "ea578f14613951d5da5446da04bdb5d2d1ee9cbf"
18
version: "0.16.5")
+17
sha: "9a9c716c147136457db2a0cc4a428686bc43a0a8"
+18
version: "0.16.6")
19
(package name: "sigil-test"
20
url: "codeberg:sigil/sigil"
21
ref: "^0.17"
src/sigil/telegram/client.sglmodified
@@ -26,6 +26,7 @@
26
27
;; Core API
28
tg-api-call
+29
tg-ack-unconfirmed?
30
31
;; Messages
32
tg-get-me
@@ -102,11 +103,31 @@
103
;;; (tg-api-call client "getMe" #{})
104
;;; ; => #{ id: 123456 is_bot: #t first_name: "MyBot" ... }
105
;;; ```
+106
;;; Is `exn` a "request sent but ack unconfirmed" error from a
+107
;;; tg-api-call? The request reached Telegram (likely delivered) but
+108
;;; the response couldn't be read — callers should treat it as a
+109
;;; best-effort success, NOT retry (a retry would re-deliver).
+110
;;; Distinct from a genuine send failure (which never carries this).
+111
(define (tg-ack-unconfirmed? exn)
+112
(and (error-object? exn)
+113
(memq 'tg-ack-unconfirmed (error-object-irritants exn))
+114
#t))
+115
116
(define (tg-api-call client method (keys: (params #{})))
117
(: tg-client? string? (params: dict?) -> any?)
107
(let ((response (http-post/json (api-url client method) params
108
timeout: (tg-client-request-timeout client)
109
connect-timeout: (tg-client-connect-timeout client))))
+118
(let ((response
+119
;; sigil-http raises 'http-ack-unconfirmed when the request
+120
;; was written but the response read failed (delivered, ack
+121
;; unknown). Re-signal it at the tg level so callers can
+122
;; distinguish it from a never-sent failure; any other error
+123
;; (incl. a connect/never-sent #f below) propagates normally.
+124
(guard (e ((http-ack-unconfirmed? e)
+125
(error (string-append "tg-api-call: " method
+126
" sent but ack unconfirmed")
+127
'tg-ack-unconfirmed)))
+128
(http-post/json (api-url client method) params
+129
timeout: (tg-client-request-timeout client)
+130
connect-timeout: (tg-client-connect-timeout client)))))
131
(unless response
132
(error (string-append "tg-api-call: HTTP request failed for " method)))
133
(if (eq? (dict-ref response ok: #f) #t)