sync single-convo cache on chat lock firehose events

Lock/unlock firehose events only wrote the convo-list cache, so an open
group chat would not update its composer footer or the agent's lockStatus
live - only after a refetch. Route the three lock handlers through
mutateConvoView so the single-convo cache (CONVO_KEY) is updated too,
which fires the ConvoProvider subscription and flips the footer live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-06-05 15:12:59 +03:00
parent 96e321dfd9
commit 6a68fc6305
@@ -418,67 +418,34 @@ export function ListConvosProviderInner({
})),
)
} else if (ChatBskyConvoDefs.isLogLockConvo(log)) {
queryClient.setQueriesData(
{queryKey: [RQKEY_ROOT]},
(old?: ConvoListQueryData) =>
optimisticUpdate(log.convoId, old, convo => {
if (ChatBskyConvoDefs.isGroupConvo(convo.kind)) {
return {
...convo,
kind: {
...convo.kind,
lockStatus: 'locked',
},
rev: log.rev,
}
}
return {
mutateConvoView(log.convoId, convo =>
ChatBskyConvoDefs.isGroupConvo(convo.kind)
? {
...convo,
kind: {...convo.kind, lockStatus: 'locked'},
rev: log.rev,
}
}),
: {...convo, rev: log.rev},
)
} else if (ChatBskyConvoDefs.isLogUnlockConvo(log)) {
queryClient.setQueriesData(
{queryKey: [RQKEY_ROOT]},
(old?: ConvoListQueryData) =>
optimisticUpdate(log.convoId, old, convo => {
if (ChatBskyConvoDefs.isGroupConvo(convo.kind)) {
return {
...convo,
kind: {
...convo.kind,
lockStatus: 'unlocked',
},
rev: log.rev,
}
}
return {
mutateConvoView(log.convoId, convo =>
ChatBskyConvoDefs.isGroupConvo(convo.kind)
? {
...convo,
kind: {...convo.kind, lockStatus: 'unlocked'},
rev: log.rev,
}
}),
: {...convo, rev: log.rev},
)
} else if (ChatBskyConvoDefs.isLogLockConvoPermanently(log)) {
queryClient.setQueriesData(
{queryKey: [RQKEY_ROOT]},
(old?: ConvoListQueryData) =>
optimisticUpdate(log.convoId, old, convo => {
if (ChatBskyConvoDefs.isGroupConvo(convo.kind)) {
return {
...convo,
kind: {
...convo.kind,
lockStatus: 'locked-permanently',
},
rev: log.rev,
}
}
return {
mutateConvoView(log.convoId, convo =>
ChatBskyConvoDefs.isGroupConvo(convo.kind)
? {
...convo,
kind: {...convo.kind, lockStatus: 'locked-permanently'},
rev: log.rev,
}
}),
: {...convo, rev: log.rev},
)
} else if (
ChatBskyConvoDefs.isLogCreateJoinLink(log) ||