Receive Real-Time Assignment State Updates Without Manual Refresh
Coordinators using the assignment status screen during active supervision sessions need real-time visibility into state changes made by peer mentors. The assignment realtime subscription manager establishes a Supabase Realtime channel filtered to the coordinator's organizational scope. When a peer mentor accepts, progresses, or completes an assignment, the state change streams to the coordinator's open screen within seconds. The subscription manager handles connection lifecycle including reconnect-on-drop to ensure reliability. This eliminates polling and provides a live supervisory dashboard experience consistent with the coordinator's high-frequency usage pattern.
User Story
Acceptance Criteria
- Given I have the assignment status screen open as a coordinator, when a peer mentor in my team changes their assignment state, then my screen updates to reflect the new state within 5 seconds without any manual action
- Given the real-time subscription is active, when a new assignment is dispatched to a peer mentor in my scope, then it appears in my list automatically
- Given the Supabase Realtime connection drops (e.g., brief network interruption), when connectivity is restored, then the subscription automatically reconnects and back-fills any missed state changes
- Given I navigate away from the assignment status screen, when the subscription manager detects the screen is no longer active, then the subscription is properly torn down to avoid unnecessary resource usage
- Given I return to the assignment status screen after navigating away, when the screen reloads, then a new subscription is established and the list shows the current state of all assignments
- Given real-time updates are streaming, when multiple state changes occur in rapid succession, then the UI updates correctly without race conditions or stale data being displayed
Business Value
Coordinators are the most active daily users of the system with longer, multi-assignment supervisory sessions. Real-time updates eliminate the friction of manual refresh and ensure coordinators act on current information, reducing the risk of duplicate follow-up actions or missed state changes. This is particularly valuable during high-activity periods such as after a batch assignment dispatch.
Components
- Assignment Realtime Subscription infrastructure
- Assignment Status Screen ui
- Assignment Tracking Service service
- Assignment Status Repository data