Implement real-time call updates using Redis and Socket.io#5
Open
LuisNoriega2021 wants to merge 12 commits into
Open
Implement real-time call updates using Redis and Socket.io#5LuisNoriega2021 wants to merge 12 commits into
LuisNoriega2021 wants to merge 12 commits into
Conversation
* added processEvent logic in Callservice * persist calls and call_events in PostgreSQl * handle call_answwered
* validate call existence before processing events * update call status from waiting to active on call_answered * flag events when waitTime exceeds 30s * persist enriched event metadata in call_events table
* validate call existence before processing events * update call status to ended
* validate call existence before processing hold events * update call status to on_hold * flags events when holdDuration exceeds 60 seconds * persist enriched metadata in calla_events
* Add support for optional status and queueId filters * Use parameterized queries to prevent SQL injection or another attack's * introduce dynamic where clause generation base on provided filters
* add unit tests for CallService covering core call lifecycle, this for all cases required
* Implements getCallEvents to retrieve ordered event history per call *Adds and completes unit and integration tests for call lifecycle events * enforcement, and business rules like answered, hold, ended * Ensures consistent event persistence
* Added Redis publish integration in CallService * Standardized event publishing using 'call_events' channel * Verified real-time event propagation via Redis
* Implement 'subscribe_call' handler to join a specific call room * Implement 'unsubscribe_call' handler to leave a call room * Remove naive global io.emit implementation
…cket * Implement Redis subscriber to listen to 'call_events' channel * Broadcast updates to clients using Socket.io rooms * Align Redis channel naming between call-service and realtime-service * Enable real-time propagation of call lifecycle events to frontend
…ime service * Implement Redis Pub/Sub in call-service to publish call events * Add Redis subscriber in realtime-service to consume events and broadcast via Socket.io * Replace mock data in frontend with real API integration * Implement useCallEvents hook with initial fetch and live event streaming * Ensure backend remains source of truth by using refetch strategy on updates * Add missing endpoint for fetching call events history
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a complete real-time event-driven flow across the system, connecting the backend, Redis, realtime service, and frontend.
Key Features
Frontend Improvements
Backend Improvements
How to Test