Skip to content

fix: silence Sentry noise from stopped limiter and benign Slack message_not_found#186

Merged
LIU9293 merged 1 commit intomainfrom
fix/sentry-noise-and-queue-rejections-04526a90
Apr 18, 2026
Merged

fix: silence Sentry noise from stopped limiter and benign Slack message_not_found#186
LIU9293 merged 1 commit intomainfrom
fix/sentry-noise-and-queue-rejections-04526a90

Conversation

@LIU9293
Copy link
Copy Markdown
Contributor

@LIU9293 LIU9293 commented Apr 18, 2026

Summary

Clean up two Sentry issues firing from ode-deamon that were not pointing at real bugs:

  • ODE-DEAMON-5 This limiter has been stopped. — dropped Bottleneck jobs in CoalescedUpdateQueue.enqueue were leaking as unhandled rejections on shutdown. Attach a .catch and resolve any still-pending enqueue callers with undefined so they don't hang.
  • ODE-DEAMON-2 / ODE-DEAMON-3 Slack message_not_found on update/delete — expected race when the status message was already deleted or replaced (very common during shutdown/finalization). Filter these out of the Sentry delivery-failure hook while keeping counters in deliveryStats intact. Same filter covers Discord unknown_message and generic not_found on update/delete.

Send failures and channel_not_found continue to surface in Sentry because those usually indicate a real permission/auth problem.

Changes

  • packages/shared/queue/coalesced-update-queue.ts — replace void limiter.schedule(...) with a .catch that also settles the enqueue promise.
  • packages/core/observability/sentry.ts — new isBenignDeliveryFailure() helper, applied before captureMessage.
  • Tests for both paths (coalesced-update-queue.test.ts, new sentry.test.ts).

Test Plan

bun test packages/shared/queue packages/core/observability

Added tests reproduce the ODE-DEAMON-5 unhandled-rejection scenario and cover the benign-failure classification.

Sentry Issues Addressed

…ck races

Two Sentry issues were firing from development traffic without pointing
at a real bug:

- ODE-DEAMON-5 "This limiter has been stopped." — CoalescedUpdateQueue
  fired jobs with `void limiter.schedule(...)`. When clear() called
  `limiter.stop({ dropWaitingJobs: true })`, Bottleneck rejected the
  dropped job promises, which then surfaced as unhandled rejections.
  Attach a .catch handler that also resolves any still-pending enqueue
  callers with undefined so they don't hang.

- ODE-DEAMON-2/3 "message_not_found" on Slack update/delete — these are
  expected races (the status message was already deleted or replaced,
  often during shutdown/finalization). Filter them out of the Sentry
  delivery-failure hook while keeping the counters intact in
  deliveryStats. Add the same filter for Discord `unknown_message` and
  generic `not_found` on update/delete. Send failures and
  channel_not_found are still captured.
@LIU9293 LIU9293 merged commit 51fc642 into main Apr 18, 2026
2 checks passed
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