Skip to content

fix: remove misspelled selector default and notify on monitor downgrade#261

Merged
bd73-com merged 2 commits intomainfrom
claude/fix-github-issues-cz4fc
Mar 23, 2026
Merged

fix: remove misspelled selector default and notify on monitor downgrade#261
bd73-com merged 2 commits intomainfrom
claude/fix-github-issues-cz4fc

Conversation

@bd73-com
Copy link
Owner

Summary

Fixes two open issues:

Closes #254
Closes #253

Changes

UI (client)

  • Cleared bogus selector default value in CreateMonitorDialog.tsx

Email notification (server/services/email.ts)

  • Added sendTierDowngradeEmail() with proper HTML escaping, plaintext sanitization, and safe href handling
  • Includes ResendUsageTracker.recordUsage() for accurate Resend cap accounting
  • Early return guard for empty monitorNames array
  • Fallback "(unnamed monitor)" for empty monitor names
  • Safe error extraction with String(error?.message ?? error)

Storage (server/storage.ts)

  • Changed downgradeHourlyMonitors() return type from number to { count: number; monitorNames: string[] } to provide monitor names for the email

Webhook handlers (server/webhookHandlers.ts)

  • Wired sendTierDowngradeEmail into all 3 downgrade paths (inactive subscription, tier change, subscription deleted)
  • Uses .catch() fire-and-forget pattern so email failures never block webhook processing

Tests

  • 11 new tests for sendTierDowngradeEmail (cap check, no API key, no email, single/plural monitors, notificationEmail preference, error handling, empty array guard)
  • 2 new tests for webhook handler downgrade email send/no-send behavior
  • Updated existing storage and webhook tests for new return type

How to test

  1. npm run check && npm run test — all 1738 tests pass
  2. npm run build — production build succeeds
  3. Open CreateMonitorDialog and verify selector field shows placeholder .price-tag or #main-content instead of pre-filled text
  4. Cancel a Pro subscription (or simulate via Stripe test webhook) and verify a downgrade notification email is sent listing affected monitors

https://claude.ai/code/session_01EaiPVsbd2waiYqem5rzKSY

claude added 2 commits March 23, 2026 18:53
…owngrade (#254, #253)

Clear the bogus "name of the selctor" default value from the selector
field so users see the placeholder instead. Add a tier-downgrade email
that lists which monitors were switched from hourly to daily when a
subscription is cancelled or downgraded.

Closes #254
Closes #253

https://claude.ai/code/session_01EaiPVsbd2waiYqem5rzKSY
… error handling

- Add recordUsage() calls to sendTierDowngradeEmail for proper Resend cap tracking
- Add early return for empty monitorNames array
- Use fallback "(unnamed monitor)" for empty monitor names in email body
- Use String(error?.message ?? error) for safer error extraction
- Add test for empty monitorNames, downgrade email send, and no-send scenarios

https://claude.ai/code/session_01EaiPVsbd2waiYqem5rzKSY
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@bd73-com has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 18928464-d577-42eb-8daa-6f72ba5a459d

📥 Commits

Reviewing files that changed from the base of the PR and between e639b71 and c2c36ae.

📒 Files selected for processing (7)
  • client/src/components/CreateMonitorDialog.tsx
  • server/services/email.test.ts
  • server/services/email.ts
  • server/storage.test.ts
  • server/storage.ts
  • server/webhookHandlers.test.ts
  • server/webhookHandlers.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-github-issues-cz4fc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the fix label Mar 23, 2026
@bd73-com bd73-com merged commit baddb93 into main Mar 23, 2026
6 checks passed
@bd73-com bd73-com deleted the claude/fix-github-issues-cz4fc branch March 23, 2026 20:52
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.

Bug: Selector field pre-filled with misspelled placeholder text Bug: No user notification when monitors are downgraded from hourly to daily

2 participants