Improve Google Meet meeting-end logic and preserve local recordings on upload failure#36
Open
nikhil2882 wants to merge 5 commits into
Open
Improve Google Meet meeting-end logic and preserve local recordings on upload failure#36nikhil2882 wants to merge 5 commits into
nikhil2882 wants to merge 5 commits into
Conversation
…000 to 3001 for development environment
- Introduced a new `recordings.ts` file to manage routes for accessing and downloading recordings. - Implemented functionality to list recordings in user directories and root, with appropriate HTML responses. - Added validation for user IDs and filenames to ensure secure access to recordings. - Updated `index.ts` to include the new recordings router in the application.
…lseAudio checks - Replaced the existing recording method with a new implementation using FFmpeg for improved performance. - Added checks for PulseAudio status and socket existence to ensure proper audio handling. - Updated browser context creation to set the PulseAudio environment for Google Meet bot. - Cleaned up unused imports and logging for better clarity and maintainability.
…t bot - Introduced a new `SilenceMonitor` class for audio silence detection, enhancing meeting end decision-making. - Implemented `ParticipantStateResolver` to determine participant presence and state changes. - Added `MeetingEndDecisionEngine` to manage meeting end logic based on silence and participant states. - Updated `GoogleMeetBot` to utilize the new classes for improved reliability in meeting management. - Enhanced configuration options in `.env.example` for inactivity detection and participant count handling. - Added tests for new functionality to ensure robustness and reliability.
…ID generation - Replaced `encodeFileNameSafebase64` with `generateTempFileId` in Google Meet, Microsoft Teams, and Zoom bots for improved clarity and consistency in temporary file ID creation. - Added a new utility function `generateTempFileId` to encapsulate the logic for generating unique temporary file IDs. - Enhanced the recordings router to escape HTML in user folder and file names for better security and presentation. - Introduced a new route to serve files from the temporary directory with validation for filename segments to prevent directory traversal attacks.
Collaborator
|
@nikhil2882 Can you Split into multiple PRs, probably like this: (a) meeting-end decision modules + tests + retention policy, (b) Google Meet FFmpeg capture switchover (with streaming upload, not buffered), (c) /recordings listing route (with auth + TTL) |
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.
Summary
SilenceMonitor,ParticipantStateResolver,MeetingEndDecisionEngine)Why
Config changes
MEETING_INACTIVITY_MINUTES(default 5)MEETING_END_FALLBACK_SILENCE_MINUTES(default 15)ENABLE_PARTICIPANT_COUNT_END(default true)New recording routes (local/temp storage)
All routes are mounted under
app.use('/recordings', recordingsRouter).GET /recordingsdist/_tempvideoin UIGET /recordings/:userIdGET /recordings/:userId/:filenameGET /recordings/_root/:filenameThese endpoints are intended as fallback access for local/OSS deployments where remote object storage is not configured or upload fails.
Validation
yarn test --runpasses locallyWhat changed in code (and expected outcome)
1) Meeting-end logic is now modular and explicit
src/lib/meeting-end/SilenceMonitor.tssrc/lib/meeting-end/ParticipantStateResolver.tssrc/lib/meeting-end/MeetingEndDecisionEngine.tssrc/lib/meeting-end/types.tssrc/bots/GoogleMeetBot.tsrecording flow.What this yields
2) Silence/fallback behavior is configurable through env
src/config.tsand.env.examplewith:MEETING_INACTIVITY_MINUTES(default5)MEETING_END_FALLBACK_SILENCE_MINUTES(default15)ENABLE_PARTICIPANT_COUNT_END(defaulttrue)What this yields
3) Timer/interval cleanup tightened in Google Meet flow
GoogleMeetBot, cleanup hooks stop silence monitoring and browser-side intervals when meeting end is decided.What this yields
4) Recording retention policy prevents data loss
src/lib/storage/retention.tssrc/lib/storage/types.tssrc/middleware/disk-uploader.tsto:What this yields
5) Local recording access routes added
src/app/recordings.tsand mounted insrc/app/index.ts.GET /recordingsGET /recordings/:userIdGET /recordings/:userId/:filenameGET /recordings/_root/:filenameWhat this yields
6) Tests added for new modules/policies
src/test/__tests__/SilenceMonitor.test.tssrc/test/__tests__/ParticipantStateResolver.test.tssrc/test/__tests__/MeetingEndDecisionEngine.test.tssrc/test/__tests__/RecordingRetentionPolicy.test.tsvitestconfig and import checks.What this yields
Exit strategy flow (how meeting termination now works)
The bot now uses a decision pipeline instead of a single DOM check.
Silence is monitored continuously
SilenceMonitorsamples audio level on an interval.Primary silence threshold triggers participant checks
MEETING_INACTIVITY_MINUTES(default5) of sustained silence, participant checks are enabled.ParticipantStateResolverevaluates page state and returns one of:participants_presentalone_confirmedremoved_from_meetingpage_state_changedunknownDecision engine applies end rules
participants_present-> continue recording.alone_confirmed-> requires repeated confirmations (streak-based) before ending.removed_from_meeting/ stablepage_state_changed-> end with explicit reason.unknown-> do not end immediately; continue monitoring.Fallback silence threshold is the safety net
MEETING_END_FALLBACK_SILENCE_MINUTES(default15), meeting ends withfallback_silence.Hard-stop conditions still apply
browser_signalmax_durationOn any end decision
This design reduces false-positive exits from fragile DOM-only participant detection while still guaranteeing eventual termination under long silence.
Notes
ea29afc,303bb52,ec50c7c,309f61f)