Skip to content

Real-time notifications for payment requests #26

@GustavoSena

Description

@GustavoSena

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

  1. Use Supabase Realtime postgres_changes subscription
  2. Filter by payer_wallet_address matching current user's wallet
  3. Request browser notification permissions on first sign-in
  4. Display browser/push notification if permitted
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions