Service Layer high complexity mobileshared
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Manages Supabase Realtime channel subscriptions using Riverpod StreamProviders, enabling coordinators and peer mentors to receive live updates on assignment statuses, peer mentor availability, and notification events without polling. Handles channel lifecycle, reconnection logic, and subscription cleanup.

Feature: Supabase Backend Core

realtime-subscription-service

Responsibilities

  • Create and manage named Realtime channels per data domain
  • Expose StreamProviders for reactive UI updates in Riverpod
  • Handle channel reconnection and error recovery automatically
  • Unsubscribe and dispose channels when features are unmounted

Interfaces

subscribeToTable(table, filter)
subscribeToChannel(channelName)
unsubscribe(channelName)
unsubscribeAll()
getStream(channelName)
broadcastPresence(payload)
onInsert(table, callback)
onUpdate(table, callback)
onDelete(table, callback)
getConnectionStatus()