Compare commits

..

1 Commits

Author SHA1 Message Date
lebaudantoine bf0315ac51 wip troubleshoot 2026-01-05 11:43:39 +01:00
10 changed files with 39 additions and 34 deletions
@@ -24,6 +24,8 @@ class RecordingEventsService:
room_name = str(recording.room.id)
print('$$ handle_update')
status_mapping = {
api.EgressStatus.EGRESS_ACTIVE: "started",
api.EgressStatus.EGRESS_ENDING: "saving",
@@ -31,12 +33,18 @@ 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
+15 -4
View File
@@ -118,12 +118,14 @@ class LiveKitEventsService:
except Exception as e:
raise InvalidPayloadError("Invalid webhook payload") from e
room_name = data.room.name or data.egress_info.room_name
if self._filter_regex and not self._filter_regex.search(room_name):
logger.info("Filtered webhook event for room '%s'", room_name)
if self._filter_regex and not self._filter_regex.search(data.room.name):
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:
@@ -131,6 +133,9 @@ 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)
@@ -143,6 +148,8 @@ 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)
@@ -151,7 +158,11 @@ 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,6 +276,8 @@ 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:
@@ -283,6 +285,9 @@ 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")
@@ -66,22 +66,16 @@ export function ToastRecordingRequest({
name: participant?.name,
})}
{!options.isMenuOpen && (
<div
<Button
size="sm"
variant="text"
className={css({
marginLeft: '0.5rem',
color: 'primary.300',
})}
onPress={options.openMenu}
>
<Button
size="sm"
variant="text"
className={css({
color: 'primary.300',
})}
onPress={options.openMenu}
>
{t('openMenu')}
</Button>
</div>
{t('openMenu')}
</Button>
)}
</HStack>
</StyledToastContainer>
@@ -161,7 +161,6 @@ export const ControlsButton = ({
fullWidth
onPress={handle}
isDisabled={isDisabled}
size="compact"
>
{t('button.start')}
</Button>
@@ -29,10 +29,9 @@ export const RowWrapper = ({
className={css({
width: '100%',
background: 'gray.100',
paddingBlock: '0.5rem',
paddingInline: '0',
padding: '8px',
display: 'flex',
marginTop: '0.25rem',
marginTop: '4px',
})}
>
<div
@@ -41,7 +40,6 @@ export const RowWrapper = ({
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
paddingInline: '0.25rem',
})}
>
{/* fixme - doesn't handle properly material-symbols */}
@@ -49,11 +47,10 @@ export const RowWrapper = ({
</div>
<div
className={css({
flex: 6,
flex: 5,
display: 'flex',
alignItems: 'center',
gap: '0.25rem',
paddingInlineEnd: '8px',
})}
>
{children}
@@ -31,12 +31,6 @@ export const buttonRecipe = cva({
borderRadius: 4,
'--square-padding': '0',
},
compact: {
borderRadius: 4,
paddingX: '0.5',
paddingY: '0.625',
'--square-padding': '{spacing.0.625}',
},
},
square: {
true: {
@@ -49,7 +49,6 @@ backend:
{{- end }}
{{- end }}
LIVEKIT_API_URL: https://livekit.127.0.0.1.nip.io/
LIVEKIT_WEBHOOK_EVENTS_FILTER_REGEX: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
ALLOW_UNREGISTERED_ROOMS: False
FRONTEND_SILENCE_LIVEKIT_DEBUG: False
FRONTEND_SUPPORT: "{'id': '58ea6697-8eba-4492-bc59-ad6562585041', 'help_article_transcript': 'https://lasuite.crisp.help/fr/article/visio-transcript-1sjq43x', 'help_article_recording': 'https://lasuite.crisp.help/fr/article/visio-enregistrement-wgc8o0', 'help_article_more_tools': 'https://lasuite.crisp.help/fr/article/visio-tools-bvxj23'}"
@@ -99,7 +98,7 @@ backend:
# Extra volume mounts to manage our local custom CA and avoid to set ssl_verify: false
extraVolumeMounts:
- name: certs
mountPath: /usr/local/lib/python3.13/site-packages/certifi/cacert.pem
mountPath: /usr/local/lib/python3.12/site-packages/certifi/cacert.pem
subPath: cacert.pem
# Extra volumes to manage our local custom CA and avoid to set ssl_verify: false
@@ -51,7 +51,6 @@ backend:
LIVEKIT_API_URL: https://livekit.127.0.0.1.nip.io/
LIVEKIT_FORCE_WSS_PROTOCOL: True
LIVEKIT_ENABLE_FIREFOX_PROXY_WORKAROUND: True
LIVEKIT_WEBHOOK_EVENTS_FILTER_REGEX: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
ALLOW_UNREGISTERED_ROOMS: False
FRONTEND_SILENCE_LIVEKIT_DEBUG: False
FRONTEND_SUPPORT: "{'id': '58ea6697-8eba-4492-bc59-ad6562585041', 'help_article_transcript': 'https://lasuite.crisp.help/fr/article/visio-transcript-1sjq43x', 'help_article_recording': 'https://lasuite.crisp.help/fr/article/visio-enregistrement-wgc8o0', 'help_article_more_tools': 'https://lasuite.crisp.help/fr/article/visio-tools-bvxj23'}"
@@ -71,7 +71,6 @@ backend:
{{- end }}
{{- end }}
LIVEKIT_API_URL: https://livekit.127.0.0.1.nip.io/
LIVEKIT_WEBHOOK_EVENTS_FILTER_REGEX: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
ALLOW_UNREGISTERED_ROOMS: False
FRONTEND_SILENCE_LIVEKIT_DEBUG: False
FRONTEND_SUPPORT: "{'id': '58ea6697-8eba-4492-bc59-ad6562585041'}"