Skip to content

feat: Add meeting leave endpoint for faster presence detection #836

Draft
deardarlingoose wants to merge 6 commits intomainfrom
feature-leave-endpoint
Draft

feat: Add meeting leave endpoint for faster presence detection #836
deardarlingoose wants to merge 6 commits intomainfrom
feature-leave-endpoint

Conversation

@deardarlingoose
Copy link
Contributor

(WIP) trigger participants update script on participant leave

…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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants