fix: handle string thread_ts from Slack properly
Issue #4380: The queue drain logic was using typeof === 'number' to check for thread IDs, which fails for Slack where thread_ts is a string like '1737766124.329349'. Changed three occurrences: - Line 43: typeof threadId !== 'number' → threadId == null - Line 49: typeof threadId === 'number' → threadId != null - Line 75: typeof originatingThreadId === 'number' → originatingThreadId != null This allows Slack string thread IDs to be properly recognized while still filtering out undefined/null values.
This commit is contained in:
parent
4de0bae45a
commit
2d5ce3e29c
@ -40,13 +40,13 @@ export function scheduleFollowupDrain(
|
|||||||
const to = item.originatingTo;
|
const to = item.originatingTo;
|
||||||
const accountId = item.originatingAccountId;
|
const accountId = item.originatingAccountId;
|
||||||
const threadId = item.originatingThreadId;
|
const threadId = item.originatingThreadId;
|
||||||
if (!channel && !to && !accountId && typeof threadId !== "number") {
|
if (!channel && !to && !accountId && threadId == null) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (!isRoutableChannel(channel) || !to) {
|
if (!isRoutableChannel(channel) || !to) {
|
||||||
return { cross: true };
|
return { cross: true };
|
||||||
}
|
}
|
||||||
const threadKey = typeof threadId === "number" ? String(threadId) : "";
|
const threadKey = threadId != null ? String(threadId) : "";
|
||||||
return {
|
return {
|
||||||
key: [channel, to, accountId || "", threadKey].join("|"),
|
key: [channel, to, accountId || "", threadKey].join("|"),
|
||||||
};
|
};
|
||||||
@ -72,7 +72,7 @@ export function scheduleFollowupDrain(
|
|||||||
(i) => i.originatingAccountId,
|
(i) => i.originatingAccountId,
|
||||||
)?.originatingAccountId;
|
)?.originatingAccountId;
|
||||||
const originatingThreadId = items.find(
|
const originatingThreadId = items.find(
|
||||||
(i) => typeof i.originatingThreadId === "number",
|
(i) => i.originatingThreadId != null,
|
||||||
)?.originatingThreadId;
|
)?.originatingThreadId;
|
||||||
|
|
||||||
const prompt = buildCollectPrompt({
|
const prompt = buildCollectPrompt({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user