feat: Add meeting leave endpoint for faster presence detection #836
Draft
deardarlingoose wants to merge 6 commits intomainfrom
Draft
feat: Add meeting leave endpoint for faster presence detection #836deardarlingoose wants to merge 6 commits intomainfrom
deardarlingoose wants to merge 6 commits intomainfrom
Conversation
…staken)
Backend:
- Add POST /rooms/{room_name}/meetings/{meeting_id}/leave endpoint
- Triggers poll_daily_room_presence_task immediately on user disconnect
- Reduces detection latency from 0-30s (periodic poll) to ~1-2s
Frontend:
- Add useRoomLeaveMeeting() mutation hook
- Add beforeunload handler in DailyRoom that calls sendBeacon()
- Guarantees API call completion even if tab closes mid-request
Context:
- Daily.co webhooks handle clean disconnects
- This endpoint handles dirty disconnects (tab close, crash, network drop)
- Redis lock prevents spam if multiple users leave simultaneously
This commit is no-mistaken and follows user requirements for readonly research
task that was later approved for implementation.
5b22683 to
775c9b6
Compare
Also trigger poll_daily_room_presence_task when user joins meeting via /join endpoint, not just on /leave. Webhooks can fail or not exist (e.g., Whereby has no participant.joined webhook), so frontend-triggered polls needed for both join and leave events.
Resolve conflict in apiHooks.ts by keeping import for createFinalURL and createQuerySerializer which are used by leave/join room functions.
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.
(WIP) trigger participants update script on participant leave