Files
Aleksander DygońandClaude Opus 5.5 f1357b2057 Tell a Telegram chat with no link how to link it (#12043)
* Tell an unlinked Telegram chat how to link it

A Telegram chat that adds the shared OpenBot bot without the one-use link
from the app has no route, so Signal discarded each update with no reply.
A user who mentioned the bot got silence and no hint.

Signal now sends one notice in such a chat when a direct message, a
mention or a command arrives and the account service answers that no host
has the chat. The text comes from the new status.messaging.telegramNotLinked
key and names the app path: Marketplace > Apps > Telegram > Add to a group
or Open a direct chat.

- The notice is sent only on a real lookup answer with hostId null. A failed
  lookup, a chat linked to an offline host, a chat that a link just routed,
  replies, threads, renames, leaves and button presses get none.
- At most one notice per chat per 24 hours, in a bounded in-memory map. The
  time is kept before the call, a failure is not retried or logged, and the
  call has no reply or thread parameters.
- A link now forgets the cached "no host" lookup of its chat.
- Slack still answers 503 for a team with no host.
- remote/api depends on @openbot/i18n, and the Dockerfile copies it.
- TELEGRAM_TEST_API_ORIGIN (loopback only) points Signal at a fake Bot API
  in scripts/signal-security-e2e.ts, which checks the notice cases.

Fixes #11875

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the Telegram notice out of chats that Signal saw linked

- Skip the notice for a chat that this Signal saw linked, revoked or
  named in a route ticket. A lookup that started before a link and
  answered after it can no longer send the notice.
- Ignore a TELEGRAM_TEST_API_ORIGIN that is not a loopback address,
  instead of turning off Telegram.
- In the Signal E2E, wait for the notice of a later chat before the
  count, so that a second notice cannot come after the assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:49:50 +01:00
..