mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-13 12:17:24 +00:00
b01a47bfd7
Currently users have no way to reliably test their connection before joining a room. To address this, we plan to build a connection-test page. The testing requires a dedicated LiveKit token, issued without going through the room API, which is tied to registered meetings, lobby rules, and longer-lived access tokens. Introduce a new viewset for all diagnostics-related features. The first route issues a token for diagnostics, even for anonymous users. Each request creates a new dedicated room so users never share the same LiveKit room during tests. Tokens are short-lived (default 10 minutes) to limit reuse, and the endpoint is throttled to prevent abuse. A Celery worker also schedules a callback that deletes the room after a certain delay, in every case.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Tasks related to connection test rooms."""
|
|
|
|
import logging
|
|
|
|
from django.conf import settings
|
|
|
|
from core.services.room_management import (
|
|
RoomManagement,
|
|
RoomManagementException,
|
|
RoomNotFoundException,
|
|
)
|
|
from core.tasks._task import task
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
@task
|
|
def delete_connection_test_room(room_name: str):
|
|
"""Force-delete an ephemeral connection-test room.
|
|
|
|
Used as a hard cap so a participant cannot keep an auto-refreshed
|
|
LiveKit session open indefinitely after requesting a test token.
|
|
"""
|
|
prefix = settings.CONNECTION_TEST_ROOM_PREFIX
|
|
if not room_name.startswith(prefix):
|
|
logger.error(
|
|
"Refusing to delete room '%s': expected prefix '%s'.",
|
|
room_name,
|
|
prefix,
|
|
)
|
|
return
|
|
|
|
try:
|
|
RoomManagement().delete_room(room_name)
|
|
except RoomNotFoundException:
|
|
# Room may already be gone after empty/departure timeout.
|
|
logger.info("Connection test room '%s' already gone.", room_name)
|
|
except RoomManagementException:
|
|
logger.exception("Failed to delete connection test room '%s'.", room_name)
|