Skip to content

Conversation

@ThyMinimalDev
Copy link
Contributor

What does this PR do?

Suppresses trigger.dev alerts for expected billing errors in the increment-usage task. These errors are expected in certain scenarios and should not trigger alerts:

  1. Temp/sandbox subscriptions: Errors like No such subscription: 'sub_temp_scale_but_should_be_per_user' where the subscription ID contains "temp" or "sandbox"
  2. Non-usage-based subscriptions: Errors like Stripe subscription (sub_xxx) is not usage based - this task only handles usage-based subscriptions

When these expected errors occur, the task now logs at info level and returns successfully instead of throwing and triggering alerts.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Trigger the increment-usage task with a subscription ID containing "temp" or "sandbox"
  2. Trigger the task for a subscription that is not usage-based
  3. Verify that in both cases:
    • The task completes successfully (no retry/alert)
    • An info-level log is recorded with the error message
  4. Verify that other errors still throw and trigger alerts as expected

Human Review Checklist

  • Verify the error message patterns ("no such subscription", "is not usage based") match actual Stripe/service error messages
  • Consider if string matching on error messages is robust enough for production
  • Note: No unit tests added for isExpectedBillingError function

Link to Devin run: https://app.devin.ai/sessions/4d9b334d74e14d929451b173847004e9
Requested by: @ThyMinimalDev

- Skip retrying and alerting for temp/sandbox subscription IDs
- Skip retrying and alerting for non-usage-based subscriptions
- Log expected errors at info level instead of error level

Co-Authored-By: morgan@cal.com <morgan@cal.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@ThyMinimalDev ThyMinimalDev marked this pull request as ready for review February 2, 2026 22:28
@graphite-app graphite-app bot added core area: core, team members only foundation labels Feb 2, 2026
@graphite-app graphite-app bot requested a review from a team February 2, 2026 22:28
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@sean-brydon sean-brydon enabled auto-merge (squash) February 3, 2026 08:28
@sean-brydon sean-brydon merged commit 336295c into main Feb 3, 2026
49 checks passed
@sean-brydon sean-brydon deleted the devin/1770066877-suppress-billing-task-alerts branch February 3, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants