Bug: Transaction vibration notifications not being sent for high-value transactions
Summary
Active subscribers with device tokens registered are not receiving vibration notifications for transactions above their threshold amount, even though:
- Webhooks are being received and processed ✅
- Transactions are being stored ✅
- Balances are being updated ✅
- Device tokens are registered and active ✅
Evidence
User: mcguirecaroline15@gmail.com (active subscriber)
Settings:
vibrations_enabled: truethreshold_amount: $50device_token: registered Dec 18, activetime_zone: Europe/Madrid
Transactions that should have triggered notifications:
| Transaction | Amount | Created | vibration_sent_at |
|-------------|--------|---------|-------------------|
| Airbnb | $574.79 | Dec 18 20:34 | NULL ❌ |
| Mecalito | $76.43 | Dec 18 20:34 | NULL ❌ |
| Mercadona | $85.76 | Dec 17 20:32 | NULL ❌ |
Production logs at 20:34-20:35 show:
- Webhook received and stored ✅
- Balance snapshots updated ✅
- Widget refresh sent ✅
- NO "VIBRATION CHECK" logs ❌
Root Cause Hypotheses
- Transactions detected as duplicates - Vibrations only process for NEW transactions. If transactions already existed in DB, they wouldn't be checked for vibrations.
- Debug logs not captured - Vibration processing logs are at
debuglevel which may not show in production.
- Bug in vibration flow -
processVibrationsForNewTransactions()may not be called ornewTransactionsarray is empty.
Additional Issues Found
Broken log statements in NotificationService.js:
// Line 65 - no interpolation
logger.info('VIBRATION CHECK []: amount=$, prefs=)}');
// Line 76 - no interpolation
logger.info('VIBRATION []: SKIP - Amount $ < threshold $');
These should use template literals with actual values for debugging.
Files to Investigate
backend/services/NotificationService.js- Fix broken logs, check threshold logicbackend/services/WebhookProcessorService.js- CheckprocessVibrationsForNewTransactions()is calledbackend/services/TransactionService.js- Check hownewTransactionsvs duplicates are determined
Steps to Reproduce
- Have an active subscriber with device token and vibrations enabled
- Trigger a webhook with transactions above threshold
- Check if
vibration_sent_atgets populated - Check production logs for "VIBRATION CHECK" entries
Expected Behavior
Transactions above threshold should:
- Trigger "VIBRATION CHECK" log
- Pass threshold check
- Send push notification
- Update
vibration_sent_atcolumn
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗