♻️(backend) sync lobby and LiveKit participant UUID generation
Refactor lobby system to use consistent UUID v4 across lobby registration and LiveKit token participant identity instead of generating separate UUIDs. Maintains synchronized identifiers between lobby cache and LiveKit participants, simplifying future participant removal operations by using the same UUID reference across both systems.
This commit is contained in:
committed by
aleb_the_flash
parent
0f76517957
commit
6c633b1ecb
@@ -2,8 +2,6 @@
|
||||
|
||||
# pylint: disable=W0223
|
||||
|
||||
import uuid
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from rest_framework import serializers
|
||||
@@ -222,17 +220,9 @@ class RequestEntrySerializer(BaseValidationOnlySerializer):
|
||||
class ParticipantEntrySerializer(BaseValidationOnlySerializer):
|
||||
"""Validate participant entry decision data."""
|
||||
|
||||
participant_id = serializers.CharField(required=True)
|
||||
participant_id = serializers.UUIDField(required=True)
|
||||
allow_entry = serializers.BooleanField(required=True)
|
||||
|
||||
def validate_participant_id(self, value):
|
||||
"""Validate that the participant_id is a valid UUID hex string."""
|
||||
try:
|
||||
uuid.UUID(hex=value, version=4)
|
||||
except (ValueError, TypeError) as e:
|
||||
raise serializers.ValidationError("Invalid UUID hex format") from e
|
||||
return value
|
||||
|
||||
|
||||
class CreationCallbackSerializer(BaseValidationOnlySerializer):
|
||||
"""Validate room creation callback data."""
|
||||
|
||||
Reference in New Issue
Block a user