diff --git a/app/eventyay/base/services/event.py b/app/eventyay/base/services/event.py index cd1ef6889f..721f95aa03 100644 --- a/app/eventyay/base/services/event.py +++ b/app/eventyay/base/services/event.py @@ -274,6 +274,8 @@ def _create_room(data, with_channel=False, permission_preset="public", creator=N channel = None if with_channel: channel = Channel.objects.create(event_id=room.event_id, room=room) + # Pre-warm the channel relationship to avoid lazy-loading issues during serialization + room.channel = channel AuditLog.objects.create( event_id=room.event_id, @@ -360,6 +362,8 @@ async def create_room(event, data, creator): async def get_room_config_for_user(room: str, event_id: str, user): room = await get_room(id=room, event_id=event_id) + if room is None: + return None permissions = await database_sync_to_async(room.event.get_all_permissions)(user) return get_room_config(room, permissions[room] | permissions[room.event]) diff --git a/app/eventyay/features/live/modules/room.py b/app/eventyay/features/live/modules/room.py index a115e0cf32..016cf29d66 100644 --- a/app/eventyay/features/live/modules/room.py +++ b/app/eventyay/features/live/modules/room.py @@ -329,6 +329,9 @@ async def push_room_info(self, body): conf = await get_room_config_for_user( body["room"], self.consumer.event.id, self.consumer.user ) + if conf is None: + # Room not found or not yet available, skip broadcasting + return if "room:view" not in conf["permissions"]: return await self.consumer.send_json( @@ -434,6 +437,9 @@ async def push_schedule_data(self, body): config = await get_room_config_for_user( body["room"], self.consumer.event.id, self.consumer.user ) + if config is None: + # Room not found or not yet available, skip broadcasting + return if "room:view" not in config["permissions"]: return await self.consumer.send_json(