Skip to content

Keep refused status alerts from crashing the API - #1475

Merged
ebma merged 1 commit into
stagingfrom
fix/status-slack-alert-crash
Nov 23, 2026
Merged

ebma merged 1 commit into
stagingfrom
fix/status-slack-alert-crash

Conversation

@ebma

@ebma ebma commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

GET /v1/status checks the Pendulum funding account and sends a Slack alert for each low balance. Those sends were fire-and-forget without a catch, so a refused send (for example a Slack 429) became an unhandled rejection and the Bun process exited with code 1. The check also created a new SlackNotifier per request, which reset the notifier's 6-hour cooldown, so every status call re-sent every alert.

  • One notifier is shared across requests, so its cooldown spaces out repeated alerts.
  • A failed send is logged as a warning and never rejects.

The status response, status codes and alert texts are unchanged.

Testing

  • New pendulum.controller.test.ts: two status calls with every balance empty and a Slack stub that always rejects. It asserts that both calls return status: false, that nothing reaches unhandledRejection, and that only one notifier is created. Without the fix the test fails on the unhandled 429 errors.
  • Full API suite with coverage: 3330 pass, 0 fail, coverage gate passed.

The Pendulum status check sends its low-balance Slack alerts without
awaiting them, so a refused send (e.g. a 429) became an unhandled
rejection and Bun exited. It also built a new notifier per request,
which reset the notifier's cooldown, so every status call re-sent
every alert. One shared notifier now spaces the alerts out, and a
failed send is only logged.
@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 25a9548
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6b03f4360fef5970c270a9b8
😎 Deploy Preview https://deploy-preview-1475--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 25a9548
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6b03f4368ea36bfd8cbb39fe
😎 Deploy Preview https://deploy-preview-1475--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 25a9548
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6b03f4362380f0bee04afeff

@ebma
ebma merged commit 1f05b22 into staging Nov 23, 2026
6 checks passed
@ebma
ebma deleted the fix/status-slack-alert-crash branch November 23, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant