A deleted or archived Slack channel leaves its room bound, agents posting into nothing, and no one told

Aperta
#2,001 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Darshan3690 ci sta già lavorando.

Dal 15/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start in core/switch_core/bridges/collaboration/slack/adapter.py: dispatch_event falls through with no branch for channel_deleted, channel_archive or channel_unarchive, and send_message swallows SlackApiError after logger.error. The manifest that requests the event subscriptions is also relevant. Done means channel_not_found and is_archived are handled as terminal, with a visible system line posted to the room; the manifest change is optional and larger.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens today

Delete (or archive) a Slack channel that a Switch room is bridged to, and Switch does not react at all.

  • The event never arrives. The app manifest requests app_home_opened, message.channels, message.groups, message.im and message.mpim. channel_deleted, channel_archive and channel_unarchive are not among them.
  • It would not be handled if it did. dispatch_event in core/switch_core/bridges/collaboration/slack/adapter.py routes slash commands, interactive payloads, message and member_joined_channel. Anything else falls off the end of the function with no branch and no log.
  • The room stays bound. bridge_id, external_channel_id and channel_type keep pointing at a channel that no longer exists, and the in-memory map is rebuilt from those rows on every restart. The only code that clears a binding is whole-workspace disconnect.
  • Agents carry on. An agent's post_message succeeds and persists, because the relay to Slack happens afterwards in a separate consumer. send_message then swallows the SlackApiError — logger.error(...) and return None — so channel_not_found and is_archived are indistinguishable from a transient failure and from each other.
  • Nobody is told. No system post in the room, no notice to a workspace admin, no telemetry event. The only durable signal is repeated error lines in the server log.

Archiving behaves identically. If someone later un-archives the channel the bridge silently resumes, because the stale mapping is still intact — accidental rather than designed.

Why this is worth fixing

This is the failure mode CLAUDE.md singles out: "Prefer a visible failure over a silent fallback" and "Never silently swallow errors to keep things 'working.'" A room whose external half has been deleted looks completely healthy from inside Switch. People go on addressing agents, agents go on answering, and none of it reaches anyone.

There is a second-order consequence worth noting separately: messages already mirrored from that channel into Switch are retained indefinitely, since message rows cascade on the room foreign key and the room is never archived or deleted. Deleting a channel in Slack therefore removes the Slack-side copy and nothing else. That may well be the correct product behaviour, but it is currently undocumented and nothing surfaces it.

Suggested direction

Smallest useful change first:

  1. Distinguish the dead-channel errors from transient ones. channel_not_found and is_archived are terminal; treating them as a generic send failure is what makes this invisible.
  2. Say so in the room. A system line ("this room's Slack channel no longer exists; messages are not reaching it") turns a silent failure into a visible one and needs no new subscription.
  3. Optionally subscribe to channel_deleted / channel_archive to react immediately rather than on the next failed send. This needs a manifest change, so it is the larger step.

Marking the room as unbridged automatically is deliberately not suggested here — that destroys the mapping an un-archive would otherwise restore, and it is a product decision rather than a bug fix.

Lingua principale
Python
Stelle
4.5k
Fork
348
Merge medio
1g 17h
PR unite (30g)
287

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sandbox-quantum/switch

Tutte le issue di sandbox-quantum/switch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.