realtime: emit and handle chat_deleted for full chat removals
All checks were successful
CI / test (push) Successful in 38s

This commit is contained in:
2026-03-08 19:41:49 +03:00
parent a896568c53
commit 744ded914d
7 changed files with 73 additions and 4 deletions

View File

@@ -263,7 +263,9 @@ async def delete_chat(
await delete_chat_for_user(db, chat_id=chat_id, user_id=current_user.id, payload=ChatDeleteRequest(for_all=for_all))
if chat_before_delete and not chat_before_delete.is_saved:
realtime_gateway.remove_chat_subscription(chat_id=chat_id, user_id=current_user.id)
if not delete_for_all:
if delete_for_all:
await realtime_gateway.publish_chat_deleted(chat_id=chat_id)
else:
await realtime_gateway.publish_chat_updated(chat_id=chat_id)