From f3b19ad4a8fbc28e3809c5581571819146a968f2 Mon Sep 17 00:00:00 2001 From: leo <260626284+cameledev@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:21:51 +0200 Subject: [PATCH] wip --- .../core/recording/services/recording_events.py | 8 -------- src/backend/core/services/livekit_events.py | 11 +++++------ .../core/tests/services/test_livekit_events.py | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/backend/core/recording/services/recording_events.py b/src/backend/core/recording/services/recording_events.py index 20fab691..fc7b76f2 100644 --- a/src/backend/core/recording/services/recording_events.py +++ b/src/backend/core/recording/services/recording_events.py @@ -77,14 +77,6 @@ class RecordingEventsService: notification_data={"type": notification_type}, ) except utils.NotificationError as e: - logger.exception( - "Failed to notify participants about recording %s: " - "room=%s, recording_id=%s, mode=%s", - event.value, - recording.room.id, - recording.id, - recording.mode, - ) raise RecordingEventsError( f"Failed to notify participants in room '{recording.room.id}' about " f"recording {event.value} (recording_id={recording.id})" diff --git a/src/backend/core/services/livekit_events.py b/src/backend/core/services/livekit_events.py index be42e3fa..ce4d882e 100644 --- a/src/backend/core/services/livekit_events.py +++ b/src/backend/core/services/livekit_events.py @@ -204,20 +204,18 @@ class LiveKitEventsService: ) def _lkes_handle_limit_reached(self, data, recording): - # Handle case: EGRESS_LIMIT_REACHED - # question: can we remove or factorize condition on ACTIVE ? + """Handle status updates to EGRESS_LIMIT_REACHED.""" if ( data.egress_info.status == api.EgressStatus.EGRESS_LIMIT_REACHED and recording.status == models.RecordingStatusChoices.ACTIVE ): try: self.recording_events.handle_limit_reached(recording) - except RecordingEventsError as e: - raise ActionFailedError( - f"Failed to process limit reached event for recording {recording}" - ) from e + except RecordingEventsError: + self._log_notification_failure(recording, "limit reached") def _lkes_handle_aborted(self, data, recording): + """Handle status updates to EGRESS_ABORTED.""" if ( data.egress_info.status == api.EgressStatus.EGRESS_ABORTED and recording.status == models.RecordingStatusChoices.ACTIVE @@ -229,6 +227,7 @@ class LiveKitEventsService: self._log_notification_failure(recording, "aborted") def _lkes_handle_failed(self, data, recording): + """Handle status updates to EGRESS_FAILED.""" if ( data.egress_info.status == api.EgressStatus.EGRESS_FAILED and recording.is_savable() diff --git a/src/backend/core/tests/services/test_livekit_events.py b/src/backend/core/tests/services/test_livekit_events.py index 710975a3..6b45fb50 100644 --- a/src/backend/core/tests/services/test_livekit_events.py +++ b/src/backend/core/tests/services/test_livekit_events.py @@ -385,7 +385,7 @@ def test_handle_egress_ended_finalizes_recording( # noqa: PLR0913 ( (EgressStatus.EGRESS_ABORTED, "active", "aborted", "screenRecordingAborted"), (EgressStatus.EGRESS_FAILED, "active", "failed", "screenRecordingFailed"), - (EgressStatus.EGRESS_FAILED, "active", "failed", "screenRecordingFailed"), + (EgressStatus.EGRESS_FAILED, "stopped", "failed", "screenRecordingFailed"), ), ) @mock.patch("core.utils.notify_participants")