Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Chloe-VP
Copy link
Contributor

Summary

Fixes #4380 - Slack thread_ts messages were being dropped because the queue drain logic used typeof === 'number' to check for thread IDs.

Problem

Slack thread_ts values are strings (e.g., '1737766124.329349'), not numbers. The original code:

if (typeof threadId !== 'number') // This fails for Slack string thread IDs

This caused valid Slack thread messages to be filtered out incorrectly.

Solution

Changed three occurrences in src/auto-reply/reply/queue/drain.ts:

  • Line 43: typeof threadId !== 'number'threadId == null
  • Line 49: typeof threadId === 'number'threadId != null
  • Line 75: typeof originatingThreadId === 'number'originatingThreadId != null

Testing

  • TypeScript compiles without errors
  • Existing queue tests pass (8 tests total)
  • Change allows string thread IDs while still filtering undefined/null values

Notes

This is a straightforward type check fix - no behavioral changes for existing numeric thread IDs.

Issue openclaw#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slack thread_ts lost during collect queue drain — typeof === "number" check drops string thread IDs

1 participant