fix(groups): sync group rename in real time for owner and members

PATCH .../groups/{topic} pushes a custom {info what:"group",
event:"group.profile.updated"} that nothing recognized, so the
sidebar/header name (native SDK contact.public.fn) never refreshed
until an unrelated focus-triggered resync happened to touch it.
Add the missing branch to onInfo (mirrors the existing
group.dissolved/message.recalled handling) to re-pull public/desc
via topic.getMeta(...withDesc()), and trigger the same refresh from
the renamer's own save success since they won't receive their own
push.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-09-18 17:36:11 +08:00
co-authored by Claude Sonnet 5
parent 0de8c0b5ac
commit 5748f1290d
2 changed files with 19 additions and 0 deletions
@@ -171,6 +171,11 @@ export function GroupDetailColumn({ topicId, peerName, onClose, onOpenHistory }:
onSuccess: (data) => {
queryClient.setQueryData(['group', topicId], (prev: GroupProfile | undefined) => (prev ? { ...prev, ...data } : data));
setNameEditing(false);
// The renamer's OWN sidebar/header (`contact.public?.fn`, native SDK state) doesn't update from
// this REST call either -- only from the `group.profile.updated` push topics.ts now listens for,
// which this account won't receive for its own action. Trigger the same SDK-sanctioned refresh
// directly instead of waiting on an unconfirmed self-echo of that push.
tinode.getTopic(topicId).getMeta(tinode.getTopic(topicId).startMetaQuery().withDesc().build()).catch(() => {});
},
onError: (err) => showError(err, '群名保存失败'),
});