Compare commits

..

2 Commits

Author SHA1 Message Date
lebaudantoine e8008b03cc ♻️(backend) refactor backend recording state management
Instead of relying on the egress_started event—which fires when egress is
starting, not actually started—I now rely on egress_updated for more accurate
status updates. This is especially important for the active status, which
triggers after egress has truly joined the room. Using this avoids prematurely
stopping client-side listening to room.isRecording updates. A further
refactoring may remove reliance on room updates entirely.

The goal is to minimize handling metadata in the mediator class. egress_starting
is still used for simplicity, but egress_started could be considered in the
future.

Note: if the API to start egress hasn’t responded yet, the webhook may fail to
find the recording because it currently matches by worker ID. This is unstable.
A better approach would be to pass the database ID in the egress metadata and
recover the recording from it in the webhook.
2026-01-05 00:00:15 +01:00
lebaudantoine a9f50e5ab0 🔥(frontend) remove useless font block on icons
Myabd, this css property is useful only on font face, it has
no effect on materials-related classes.
2026-01-04 23:29:40 +01:00
5 changed files with 1 additions and 30 deletions
+1 -1
View File
@@ -235,7 +235,7 @@ services:
- livekit-egress
livekit-egress:
image: livekit/egress:v1.11.0
image: livekit/egress
environment:
EGRESS_CONFIG_FILE: ./livekit-egress.yaml
volumes:
@@ -24,8 +24,6 @@ class RecordingEventsService:
room_name = str(recording.room.id)
print('$$ handle_update')
status_mapping = {
api.EgressStatus.EGRESS_ACTIVE: "started",
api.EgressStatus.EGRESS_ENDING: "saving",
@@ -33,18 +31,12 @@ class RecordingEventsService:
}
recording_status = status_mapping.get(egress_status)
print('$$ recording_status')
print(recording_status)
if recording_status:
try:
print('$$ update')
utils.update_room_metadata(
room_name, {"recording_status": recording_status}
)
except utils.MetadataUpdateException as e:
print('$$ exception')
logger.exception("Failed to update room's metadata: %s", e)
@staticmethod
@@ -122,10 +122,6 @@ class LiveKitEventsService:
logger.info("Filtered webhook event for room '%s'", data.room.name)
return
print('$$ data.event')
print(data.event)
print(data)
try:
webhook_type = LiveKitWebhookEventType(data.event)
except ValueError as e:
@@ -133,9 +129,6 @@ class LiveKitEventsService:
f"Unknown webhook type: {data.event}"
) from e
print("$$ webhook_type")
print(webhook_type)
handler_name = f"_handle_{webhook_type.value}"
handler = getattr(self, handler_name, None)
@@ -148,8 +141,6 @@ class LiveKitEventsService:
def _handle_egress_updated(self, data):
"""Handle 'egress_updated' event."""
print("$$ _handle_egress_updated")
egress_id = data.egress_info.egress_id
try:
recording = models.Recording.objects.get(worker_id=egress_id)
@@ -158,11 +149,7 @@ class LiveKitEventsService:
f"Recording with worker ID {egress_id} does not exist"
) from err
print("$$ egress found")
egress_status = data.egress_info.status
print('$$ egress_status')
print(egress_status)
self.recording_events.handle_update(recording, egress_status)
def _handle_egress_ended(self, data):
-5
View File
@@ -276,8 +276,6 @@ async def update_room_metadata(
room = response.rooms[0]
existing_metadata = json.loads(room.metadata) if room.metadata else {}
print('$$ existing_metadata')
print(existing_metadata)
if remove_keys:
for key in remove_keys:
@@ -285,9 +283,6 @@ async def update_room_metadata(
updated_metadata = {**existing_metadata, **metadata}
print('$$ updated_metadata')
print(updated_metadata)
await lkapi.room.update_room_metadata(
UpdateRoomMetadataRequest(
room=room_name, metadata=json.dumps(updated_metadata).encode("utf-8")
@@ -1,9 +1,6 @@
replicaCount: 1
terminationGracePeriodSeconds: 18000
image:
tag: v1.11.0
egress:
log_level: debug
ws_url: ws://livekit-livekit-server:80