Summary
Implement real-time notifications when a payment request is received by a user.
Current Behavior
Payment requests are loaded on page load and refreshed periodically (every 30 seconds via polling).
Desired Behavior
Users should receive instant notifications when someone sends them a payment request, without needing to manually refresh or wait for the polling interval.
Implementation Details
- Subscribe to Supabase Realtime channel for
payment_requests table
- Filter subscriptions to only receive events where the current user is the payer (
payer_wallet_address)
- Show a push notification or in-app toast notification when a new request arrives
- Automatically update the requests list without requiring manual refresh
Technical Approach
- Use Supabase Realtime
postgres_changes subscription
- Filter by
payer_wallet_address matching current user's wallet
- Request browser notification permissions on first sign-in
- Display browser/push notification if permitted
- Update local state with new request immediately
Benefits
- Instant notification when someone requests money
- Better user engagement and responsiveness
- More app-like experience
Priority
Medium - The current 30-second polling works but real-time would significantly improve UX.
Summary
Implement real-time notifications when a payment request is received by a user.
Current Behavior
Payment requests are loaded on page load and refreshed periodically (every 30 seconds via polling).
Desired Behavior
Users should receive instant notifications when someone sends them a payment request, without needing to manually refresh or wait for the polling interval.
Implementation Details
payment_requeststablepayer_wallet_address)Technical Approach
postgres_changessubscriptionpayer_wallet_addressmatching current user's walletBenefits
Priority
Medium - The current 30-second polling works but real-time would significantly improve UX.