A notice answers its thing, and brings its message back with a button¶
Context¶
A thing's message is edited in place, which notifies nobody, so news of a thing that is open comes as a notice below it: a new entry of an alarm or of the security message (0022), a comment or a review (0011), new commits, a reopen or ready for review (0026), and a draft of the control repository that only goes to read, since the maintainer's own text stays the reply. Inside a topic, a notice was a plain message without buttons: the topic was what it belonged to. The maintainer found a topic named after an open alarm that held only such a notice, without the alarm's message and without a button, and nothing in it led to the alarm. How it came to that is not known. The code shows three ways in which a notice leads nowhere: the thing's message was deleted on the maintainer's side only, which the bot doesn't see, since its edits still succeed; it is far above, after many notices; or it was left in another topic, when Telegram answered message thread not found for a topic that is still there, and the thing opened a new one, as 0017 does for a topic that the maintainer deleted. In the last case the old topic kept its open name for good, and when a notice opened the new topic, the old message kept its live buttons in the old one.
A fresh message of a thing, such as ⏰ Later when its time is up, deleted the old one and nothing else. Telegram deletes no message older than 48 hours, so the old one kept its buttons beside the new one, as with the reminder of a vulnerability report on the day before its deadline.
Options¶
- A reply alone: the notice quotes the thing's message, in the topic as in the main view. It leads to the message while the bot and the maintainer see it, and to nothing when he deleted it on his side only.
- A new message of the thing for every notice, as 0022 rejected: a message more for each piece of news, a delete that fails after 48 hours, and two messages with buttons.
- A reply and a button, ⬇️ Show, on each notice, which sends the thing's message anew at the end of its topic when the maintainer presses it; a topic that a thing leaves is renamed, and every fresh message takes the buttons off the old one.
- Delete the topic that a thing leaves with
deleteForumTopic. When Telegram's answer was right, the call does nothing; when it was wrong, it deletes a topic that is still there, with its history, for good.
Decision¶
Option 3, which the maintainer chose (Antwort + Knopf), without option 4.
- The notice answers. It goes with
reply_parametersfor the thing's message, withallow_sending_without_reply, so a message that is gone for the bot too costs no error. The reply is the choice of each caller: the notices of a bundle, of a comment, a review and an activity, and the draft only to read take it. The pictures of a release are content, not a pointer, and a proposal has its own ✅ Confirm, so both stay as they were. - The notice carries ⬇️ Show,
show:<id>. It is no action of the allowlist of 0002: the thing's own message never shows it, and a press asks its own rule,offersShow(), whether the thing is not done, which covers an ignored and a cleared thing. Every other button keeps the allowlist as its one rule. A press sends the thing's message anew, silently, as the maintainer looks at the chat, with all its buttons, into the topic that the thing names now; the thing keeps its state, a ⏰ Later too. That is not option 2: nothing is sent unless he presses. The notice loses its button after the press, as a proposal's does. - A fresh message of a thing retires the old one: it deletes it, or, when Telegram refuses, edits it to the thing as it is, without buttons, as 0021 did only for a message that moved out of the main view. So no two messages of a thing offer buttons.
- A topic that a thing leaves is renamed ↪️ Moved: … with its old name, and never deleted: one call, no read and no write, passed over without a line in the log for a topic that is gone, the usual case of 0017. When a notice opens the new topic, the thing's old message in the old topic is retired as well. Its link stays, and the maintainer deletes the topic by hand when he wants.
Consequences¶
Every notice leads to its thing: by the quote while the message is in view, and by ⬇️ Show when it is far above, deleted on the maintainer's side or left in another topic. The reply and the button cost nothing until a press: a notice is the same one sendMessage. A press costs one request of the Worker and one of the Durable Object, one read and one write of Workers KV, and answerCallbackQuery, sendMessage, deleteMessage (with one editMessageText when Telegram refuses it) and editMessageReplyMarkup for the notice; a refused one costs one read and no write, as test/costs.test.ts checks. A fresh message costs one editMessageText more only when Telegram refuses the delete, and a thing that leaves a topic one editForumTopic and, after a notice, one deleteMessage, so the budgets of a run of the schedule grow with them: SHOW_AGAIN from 8 to 10 calls, ALARM_CHANGE from 11 to 14 and the reminder of a report from 5 to 6.
What only the live chat can show: how Telegram draws a reply to a message that the maintainer deleted on his side only, whether such a message stays editable for the bot in every kind of chat, and what Telegram answers to editForumTopic and deleteMessage for a deleted topic, which the pager takes as TOPIC_ID_INVALID or message thread not found and message to delete not found.