fix(notifications): don't auto-enable deployment balance alert - #3181
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe PR removes deployment escrow balance handling from the auto-enable alert flow: the exported ChangesRemove escrow balance from deployment alerts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Auto top-up is the default for managed wallets, so balance alerts are redundant for most users and produce email spam (and email cost) when deployments are closed in batches. Stop auto-creating the balance alert on deployment creation; users can still enable it manually from the Alerts tab. The deployment-closed alert remains auto-enabled. Side benefit: drops the per-deployment chain RPC call used only to compute the balance-alert threshold.
db585bc to
0296efc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3181 +/- ##
==========================================
- Coverage 63.70% 62.27% -1.44%
==========================================
Files 1089 1009 -80
Lines 26449 24555 -1894
Branches 6417 6037 -380
==========================================
- Hits 16850 15292 -1558
+ Misses 8403 8094 -309
+ Partials 1196 1169 -27
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
Why
Auto top-up is the default for managed wallets, so the deployment balance alert is redundant for the majority of users. Worse: when a user closes a batch of deployments, escrow drops below the auto-created threshold and the balance alert fires once per deployment, spamming the user with emails (and costing us money).
There is no suppression path between auto top-up and balance alerts in
apps/notificationstoday — they're fully independent.What
deploymentBalancealert when a deployment is created. The post-deploy job now only enablesdeploymentClosed(one-shot, not noisy).getDeploymentEscrowBalance) that was only used to compute the auto-enabled threshold.Files changed
apps/api/src/notifications/services/notification/notification.service.ts— drop balance alert from upsert; remove threshold calc; dropescrowBalancefrom input.apps/api/src/app/services/enable-deployment-alert/enable-deployment-alert.handler.ts— dropDeploymentHttpServicedependency and chain fetch.apps/deploy-web/tests/ui/managed-wallet-alerts.spec.ts— flip the default-state assertion (balance toggle starts off) and enable the toggle before updating the threshold.The
chore(repo): sync package-lock.jsoncommit is preparatory: the lockfile onmainwas out of sync withpackage.json, causing thenpm ci --dry-runpre-commit check to fail on any commit. Synced as a separate commit so it can be reviewed independently.Summary by CodeRabbit
Bug Fixes
Refactor
Tests