From cb37e735b0caf785cf900a26c45f57a3d9721a85 Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 8 Mar 2026 21:31:58 +0300 Subject: [PATCH] feat(web): add chat info sync polling fallback --- docs/core-checklist-status.md | 2 +- web/src/components/ChatInfoPanel.tsx | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/core-checklist-status.md b/docs/core-checklist-status.md index a142513..5559757 100644 --- a/docs/core-checklist-status.md +++ b/docs/core-checklist-status.md @@ -40,7 +40,7 @@ Legend: 31. Privacy - `DONE` (avatar/last-seen/group-invites + PM policy `everyone|contacts|nobody`; API + web settings support all matrix values; integration tests cover PM policy matrix, group-invite policy matrix, private chat counterpart visibility `nobody/contacts/everyone`, and avatar visibility in search `everyone/contacts/nobody`) 32. Security - `DONE` (sessions + revoke + 2FA + access-session visibility; integration tests cover single-session revoke, revoke-all invalidation/force-disconnect, 2FA setup guard, recovery-code normalization/lifecycle, and disable-2FA cleanup; web auth supports recovery-code login; settings provides recovery-code warning/copy/download) 33. Realtime Events - `DONE` (connect/disconnect/send/receive/typing/read/delivered/online/offline + chat/message updates + chat_deleted) -34. Sync - `DONE` (cross-device via backend state + realtime; reconciliation for loaded chats/messages; `chat_updated` covers profile/membership/delete-for-self/archive/unarchive/pin/unpin/mute/clear and create-chat fanout to members; full-chat delete emits `chat_deleted`; integration tests cover user-scoped archive/pin, member-side visibility after create, and user-scoped clear behavior; chat list and migration `0026_deduplicate_saved_chats` handle historical duplicate Saved Messages) +34. Sync - `DONE` (cross-device via backend state + realtime; reconciliation for loaded chats/messages; `chat_updated` covers profile/membership/delete-for-self/archive/unarchive/pin/unpin/mute/clear and create-chat fanout to members; full-chat delete emits `chat_deleted`; web Chat Info also has 15s polling fallback to self-heal missed realtime updates; integration tests cover user-scoped archive/pin, member-side visibility after create, and user-scoped clear behavior; chat list and migration `0026_deduplicate_saved_chats` handle historical duplicate Saved Messages) 35. Additional - `PARTIAL` (drafts/link preview partial/autoload media basic) ## Current Focus beyond P0 diff --git a/web/src/components/ChatInfoPanel.tsx b/web/src/components/ChatInfoPanel.tsx index 7e09b53..fd8e57d 100644 --- a/web/src/components/ChatInfoPanel.tsx +++ b/web/src/components/ChatInfoPanel.tsx @@ -290,6 +290,16 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) { return () => window.removeEventListener("bm:chat-updated", onRealtimeChatUpdated); }, [open, chatId]); + useEffect(() => { + if (!open || !chatId) { + return; + } + const timer = window.setInterval(() => { + void refreshPanelData(chatId, false); + }, 15000); + return () => window.clearInterval(timer); + }, [open, chatId]); + useEffect(() => { const onKeyDown = (event: KeyboardEvent) => { if (event.key === "Escape") {