feat(p0): complete account security privacy and sync hardening
Some checks failed
CI / test (push) Failing after 2m10s

This commit is contained in:
2026-03-08 21:19:12 +03:00
parent 6b724e260f
commit 5909503012
4 changed files with 178 additions and 11 deletions

View File

@@ -101,7 +101,10 @@ async def create_chat(
current_user: User = Depends(get_current_user),
) -> ChatRead:
chat = await create_chat_for_user(db, creator_id=current_user.id, payload=payload)
realtime_gateway.add_chat_subscription(chat_id=chat.id, user_id=current_user.id)
member_user_ids = await chats_repository.list_chat_member_user_ids(db, chat_id=chat.id)
for member_user_id in member_user_ids:
realtime_gateway.add_chat_subscription(chat_id=chat.id, user_id=member_user_id)
await realtime_gateway.publish_chat_updated(chat_id=chat.id)
return await serialize_chat_for_user(db, user_id=current_user.id, chat=chat)
@@ -284,6 +287,7 @@ async def clear_chat(
current_user: User = Depends(get_current_user),
) -> None:
await clear_chat_for_user(db, chat_id=chat_id, user_id=current_user.id)
await realtime_gateway.publish_chat_updated(chat_id=chat_id)
@router.post("/{chat_id}/pin", response_model=ChatRead)