fix(consumers): serve /health on the Bolt receiver for Railway healthcheck#266
Merged
Merged
Conversation
…check Railway gates deploys by probing $PORT/health, and the Slack Bolt receiver is the server bound to $PORT (3004). The /health endpoint only existed on the separate webhook server (WEBHOOK_API_PORT, 3003), which Railway never probes, so the healthcheck 404'd and dev deploys failed (replicas never became healthy). Add a /health custom route to the Bolt HTTPReceiver so the probe on $PORT returns 200 and deploys can complete. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brunod-e
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
Deploys do
consumerno ambiente dev do Railway falhavam (1/1 replicas never became healthy), enquanto a prod seguia de pé. Todos os PRs recentes pradevquebravam no deploy.Causa raiz
O healthcheck do Railway bate em
$PORT/health(doc: "This variable's value is also used when performing health checks on your deployments"). No consumer,PORT=3004é a porta do Slack Bolt, que não tinha rota/health. O endpoint/healthreal vive no webhook server (WEBHOOK_API_PORT=3003), que o Railway não sonda.Resultado: a sonda tomava 404 (
Unhandled HTTP request (GET) made to /health) e o deploy nunca ficava healthy. A config é antiga (healthcheck/healthexiste desde abr/2026); o dev só passou a exercê-la recentemente. A prod sobrevivia rodando um deployment que não reexecutava a sonda/health.Fix
Adiciona uma rota
/healthaoHTTPReceiverdo Bolt (a porta que o Railway sonda), retornando200. Assim o healthcheck passa independente de qual porta o Railway resolver.Verificação
tsc(build do consumer) passa limpo.Unhandled /health, o healthcheck fica verde e o deploy completa.Follow-up (não incluso neste PR)
Hardening do
409 Conflictdo Telegram:telegramBotService.launch()é fire-and-forget; um conflito de poller pode crashar o processo em loop e derrubar deploys. Tratar a rejeição evita isso.🤖 Generated with Claude Code