Slack adapter: unfurl wait blocks webhook handling up to 2s per link (4s for edits)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start by locating enrichLinks and UNFURL_WAIT_MS in the Slack adapter, then read the link preview work in #395 to understand the intended cache behavior. Check how incoming messages and message_changed events use the enriched links. The issue is resolved when webhook handling no longer waits up to two seconds per uncached link (or the wait can be disabled) while cached previews still work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
@chat-adapter/slack 4.39.0 waits up to 2 seconds for link-preview (unfurl) data on every incoming message that contains a link with no cached preview. The wait runs inside webhook handling, before the event reaches the app. Links Slack never unfurls (internal admin URLs, bot posts sent with unfurl_links: false) always wait the full 2 seconds. A message_changed event parses both the old and the new text, so an edit waits twice.
Impact
Hosts that must answer Slack's webhook within a fixed window can't accept these events. We run Paperclip, which gives the SDK 2.5 seconds, so every message with an unpreviewed link and every edit gets a 503 on each retry and is eventually dropped.
Measurements
Live adapter, real bot token, one bot post with a link:
- as sent: 2,137 ms in the adapter (14 state reads of
slack:unfurls:<ts>, 150 ms apart) - same post with the link removed: 33 ms
- an edit of that post: 4,245 ms
Where
enrichLinks with UNFURL_WAIT_MS = 2e3, polling chat state every 150 ms. It looks like this arrived with the link-preview work in #395.
Suggested fix
Don't block webhook handling on unfurls: read the cached unfurl once and move on, or make the wait configurable (0 to disable). Setting UNFURL_WAIT_MS to 0 fixed it for us; one read takes about 0 ms.
- Lingua principale
- TypeScript
- Stelle
- 2.5k
- Fork
- 355
- Merge medio
- 2g 15h
- PR unite (30g)
- 42
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel/chat
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
X and Twitch: paragraphs inside a block quote are joined with no spaceForse già presa @abhiramshaji-cyber l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
solidjs/solid-docs#1716 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Progress indicated by console logs is off by oneForse già presa @marceliwac l’ha presa oggi. Apertabug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-samples/aws-cdk-examples#1336 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
melgarafael/DeskcommCRM#4999 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni