mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Fix task message routing fallbacks
This commit is contained in:
@@ -76,7 +76,10 @@ async function fetchRouteTargetEvents(
|
||||
}
|
||||
|
||||
const targetThreadRef = getThreadReference(targetEvent.tags);
|
||||
const threadRootId = targetThreadRootId ?? targetThreadRef.rootId ?? null;
|
||||
const threadRootId =
|
||||
targetThreadRootId ??
|
||||
targetThreadRef.rootId ??
|
||||
(targetAgentConversationReplyId ? targetEvent.id : null);
|
||||
if (threadRootId && !eventsById.has(threadRootId)) {
|
||||
addEvent(await fetchRouteEvent(threadRootId));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
formatDayHeading,
|
||||
formatTime,
|
||||
} from "@/features/messages/lib/dateFormatters";
|
||||
import { isBroadcastReply } from "@/features/messages/lib/threading";
|
||||
import type { TimelineMessage } from "@/features/messages/types";
|
||||
import {
|
||||
resolveUserLabel,
|
||||
@@ -209,9 +210,14 @@ export function ChannelTasksView({
|
||||
messageById.get(marker.threadRootId) ??
|
||||
messageById.get(marker.parentMessageId ?? "") ??
|
||||
null;
|
||||
const isBroadcastTaskSource = message
|
||||
? isBroadcastReply(message.tags ?? [])
|
||||
: false;
|
||||
const threadMessage =
|
||||
resolvedThreadMessage ??
|
||||
(marker.threadRootId === marker.agentReplyId ? message : null);
|
||||
(marker.threadRootId === marker.agentReplyId || isBroadcastTaskSource
|
||||
? message
|
||||
: null);
|
||||
return {
|
||||
marker,
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user