private shares and revokation works
This commit is contained in:
@@ -60,9 +60,20 @@ async def websocket_endpoint(
|
||||
# CRITICAL: Close the DB session immediately after authentication
|
||||
db.close()
|
||||
|
||||
# Add to connection manager (don't call accept again)
|
||||
manager.active_connections.setdefault(str(map_id), set()).add(websocket)
|
||||
logger.info(f"Client connected to map {map_id}. Total connections: {len(manager.active_connections[str(map_id)])}")
|
||||
# Add to connection manager (don't call accept again, connect method will accept)
|
||||
# Note: We need to call connect but it will try to accept again, so we skip it
|
||||
# Instead, manually add the connection
|
||||
user_id = user.id if user else None
|
||||
map_key = str(map_id)
|
||||
|
||||
if map_key not in manager.active_connections:
|
||||
manager.active_connections[map_key] = set()
|
||||
|
||||
manager.active_connections[map_key].add((websocket, user_id))
|
||||
manager.websocket_to_map[websocket] = map_key
|
||||
|
||||
user_info = f"user {user_id}" if user_id else "guest"
|
||||
logger.info(f"Client ({user_info}) connected to map {map_id}. Total connections: {len(manager.active_connections[map_key])}")
|
||||
|
||||
try:
|
||||
# Send initial connection message
|
||||
|
||||
Reference in New Issue
Block a user