diff --git a/app/chats/router.py b/app/chats/router.py index b3f526f..90a1524 100644 --- a/app/chats/router.py +++ b/app/chats/router.py @@ -314,12 +314,14 @@ async def update_chat_notifications( db: AsyncSession = Depends(get_db), current_user: User = Depends(get_current_user), ) -> ChatNotificationSettingsRead: - return await update_chat_notification_settings_for_user( + settings = await update_chat_notification_settings_for_user( db, chat_id=chat_id, user_id=current_user.id, payload=payload, ) + await realtime_gateway.publish_chat_updated(chat_id=chat_id) + return settings @router.post("/{chat_id}/archive", response_model=ChatRead) @@ -329,6 +331,7 @@ async def archive_chat( current_user: User = Depends(get_current_user), ) -> ChatRead: chat = await set_chat_archived_for_user(db, chat_id=chat_id, user_id=current_user.id, archived=True) + await realtime_gateway.publish_chat_updated(chat_id=chat_id) return await serialize_chat_for_user(db, user_id=current_user.id, chat=chat) @@ -339,6 +342,7 @@ async def unarchive_chat( current_user: User = Depends(get_current_user), ) -> ChatRead: chat = await set_chat_archived_for_user(db, chat_id=chat_id, user_id=current_user.id, archived=False) + await realtime_gateway.publish_chat_updated(chat_id=chat_id) return await serialize_chat_for_user(db, user_id=current_user.id, chat=chat) @@ -349,6 +353,7 @@ async def pin_chat( current_user: User = Depends(get_current_user), ) -> ChatRead: chat = await set_chat_pinned_for_user(db, chat_id=chat_id, user_id=current_user.id, pinned=True) + await realtime_gateway.publish_chat_updated(chat_id=chat_id) return await serialize_chat_for_user(db, user_id=current_user.id, chat=chat) @@ -359,6 +364,7 @@ async def unpin_chat( current_user: User = Depends(get_current_user), ) -> ChatRead: chat = await set_chat_pinned_for_user(db, chat_id=chat_id, user_id=current_user.id, pinned=False) + await realtime_gateway.publish_chat_updated(chat_id=chat_id) return await serialize_chat_for_user(db, user_id=current_user.id, chat=chat) diff --git a/docs/core-checklist-status.md b/docs/core-checklist-status.md index c5e186d..df74e62 100644 --- a/docs/core-checklist-status.md +++ b/docs/core-checklist-status.md @@ -34,13 +34,13 @@ Legend: 25. Admin Rights - `PARTIAL` (delete/pin/edit info + explicit ban API for groups/channels; integration tests cover channel member read-only, channel admin full-delete, channel message delete-for-all permissions, group profile edit permissions, and owner-only role management rules; remaining UX moderation tools limited) 26. Channels - `PARTIAL` (create/post/edit/delete/subscribe/unsubscribe; UX edge-cases still polishing) 27. Channel Types - `DONE` (public/private) -28. Notifications - `PARTIAL` (browser notifications + mute/settings; chat mute is propagated in chat list payload, honored by web realtime notifications with mention override, and mute toggle now syncs instantly in chat store; no mobile push infra) +28. Notifications - `PARTIAL` (browser notifications + mute/settings; chat mute is propagated in chat list payload, honored by web realtime notifications with mention override, and mute toggle now syncs instantly in chat store; backend now emits `chat_updated` after notification mute/unmute for cross-tab consistency; no mobile push infra) 29. Archive - `DONE` 30. Blacklist - `DONE` 31. Privacy - `PARTIAL` (avatar/last-seen/group-invites + PM policy `everyone|contacts|nobody`; group-invite `nobody` is available in API and web settings; integration tests cover PM policy matrix (`everyone/contacts/nobody`), group-invite policy matrix (`everyone/contacts/nobody`), private chat counterpart visibility for `nobody/contacts/everyone`, and avatar visibility matrix in search for `nobody/contacts` (with contact allowance), remaining UX/matrix hardening) 32. Security - `PARTIAL` (sessions + revoke + 2FA base + access-session visibility; integration tests cover single-session revoke and revoke-all invalidation/force-disconnect; 2FA setup now blocked after enable to prevent secret re-issuance; one-time recovery codes added and covered for normalization/lifecycle (`remaining_codes` decrement + one-time usage); web auth panel supports recovery-code login; settings now warns when recovery codes are empty and provides copy/download actions for freshly generated codes) 33. Realtime Events - `DONE` (connect/disconnect/send/receive/typing/read/delivered/online/offline + chat/message updates + chat_deleted) -34. Sync - `PARTIAL` (cross-device via backend state + realtime; reconciliation improved for loaded chats/messages, chat-info panel hot-refreshes on `chat_updated`, delete/leave updates realtime subscriptions, full-chat delete emits `chat_deleted`) +34. Sync - `PARTIAL` (cross-device via backend state + realtime; reconciliation improved for loaded chats/messages, chat-info panel hot-refreshes on `chat_updated`, delete/leave updates realtime subscriptions, full-chat delete emits `chat_deleted`, and per-user chat state mutations (archive/unarchive/pin/unpin/mute) now emit `chat_updated`) 35. Additional - `PARTIAL` (drafts/link preview partial/autoload media basic) ## Current Focus to reach ~80%