Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)
Mantenedores costumam responder em até 1 dia
@mangeshraut712 já está trabalhando nisso.
Desde 14/10/2026.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- nextjs, typescript
Direção de pesquisa
Comece por parseCapShareUrl em apps/web/lib/oembed.ts, que é chamada por processSlackEvent e por /api/oembed, e verifique como serverEnv().WEB_URL já é lido em outros pontos de apps/web. Confirme que um link /s/<id> em um host que não seja cap.so retorna null hoje. Está pronto quando um link de compartilhamento no host configurado em WEB_URL é resolvido para um ID de vídeo nos dois caminhos, e os links em outros hosts continuam retornando null.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
On a self-hosted Cap server, the Slack integration never shows a preview or inline player for share links on the server's own domain.
The Slack app installs and connects fine, Slack sends link_shared events, and /api/integrations/slack/events returns 200, but Cap never calls chat.unfurl. Nothing is logged, so it fails silently.
Expected: a public link like https://video.example.com/s/<id> unfurls in Slack with the title, thumbnail and inline player, the same as cap.so links.
Actual: Slack shows a plain link. Because the app claims the domain, Slack also skips its own Open Graph preview, so it's worse than having no app installed.
Cause: processSlackEvent passes each link through parseCapShareUrl (apps/web/lib/oembed.ts), which only accepts Cap's hosted domains:
if (hostname === "cap.so" && segments.length === 2 && segments[0] === "s") {
videoId = segments[1];
}
if (hostname === "cap.link" && segments.length === 1 && segments[0] !== "video") {
videoId = segments[0];
}
For any other host it returns null, so the link is dropped before the video is looked up. /api/oembed uses the same function, so it returns 400 for the server's own links, even though the share page advertises that oEmbed URL.
Suggested fix: also accept the host of WEB_URL with the /s/<id> path:
const webHost = new URL(serverEnv().WEB_URL).hostname.toLowerCase().replace(/^www\./, "");
if ((hostname === "cap.so" || hostname === webHost) && segments.length === 2 && segments[0] === "s") {
videoId = segments[1];
}
This fixes both Slack unfurls and /api/oembed on self-hosted servers.
Reproduction
- Run Cap self-hosted with
WEB_URL=https://video.example.com(officialcap-webDocker image). - Create a Slack app from
apps/web/slack-app-manifest.json, replacingcap.sowithvideo.example.comin the unfurl domain, redirect URL and event URL. - Set
SLACK_CLIENT_ID,SLACK_CLIENT_SECRETandSLACK_SIGNING_SECRET, restart cap-web, and verify the event URL in Slack (it verifies). - In Cap: Organization Settings → Integrations → Slack → Connect (it connects).
- Use a public video with no password; the organization has no access email domain.
- Paste
https://video.example.com/s/<id>in a Slack channel. - No preview appears. The server receives the Slack event (200), and Slack never loads
/embed/<id>.
Quick check without Slack:
curl -s -o /dev/null -w "%{http_code}\n" \
"https://video.example.com/api/oembed?url=https%3A%2F%2Fvideo.example.com%2Fs%2F<id>&format=json"
# returns 400 (expected 200 with oEmbed JSON)
Additional Context
- Cap version: official
ghcr.io/capsoftware/cap-webDocker image built 2026-09-07 (arm64sha256:5b65d137f7f7ddd767e1acb37380a4609f43287458410515a013157b56cfa83d). The sameparseCapShareUrlcode is onmaintoday. - Operating system, version: server is Linux arm64 (AWS ECS Fargate), self-hosted with Aurora MySQL and S3,
NEXT_PUBLIC_IS_CAPnot set. Slack desktop app on macOS. - Device (optional): n/a (server-side issue)
- Related: #2058 (Slack integration), #2122 / #2123 (share metadata on custom domains). Those fixed the Open Graph tags; this is the separate Slack-app path.
- Linguagem predominante
- Rust
- Estrelas
- 23.2k
- Forks
- 2k
- Merge médio
- 1d 10h
- PRs com merge (30d)
- 100
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CapSoftware/Cap
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CapSoftware/Cap#2384 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dashboard pagination causes full page reloads on self-hosted CapTalvez já em andamento @Dewin assumiu há 26 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
CapSoftware/Cap#2305 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CapSoftware/Cap#1714 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
perf: investigate redundant caption lookup passes during renderingTalvez já em andamento @KrishCodesw assumiu hoje. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
CapSoftware/Cap#2523 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
GPUI playback hitches during background edits on long recordingsTalvez já em andamento @AksharP5 assumiu hoje. Aberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 45/100
CapSoftware/Cap#2506 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de CapSoftware/Cap
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
bytecodealliance/rustix#1703 ·
Mantenedores costumam responder em até 3 dias
-
bug discussion
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
medialab/xan#1201 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
farion1231/cc-switch#8298 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ajeetdsouza/zoxide#1323 ·
Mantenedores costumam responder em até 1 dia