Skip to content

chat_postMessage accepts thread_ts as a float but does not create a thread #840

@iyakushev

Description

@iyakushev

Whenever a float timestamp is provided into the thread_ts of the chat_postMessage method slack returns {'ok': True, ... } in its response but no thread is created. The same message with a string as a timestamp will create a thread and post message as expected. I understand that the intended use is with a string. However, I find it strange that slackclient does not catch any type errors like this, or if it internally cast it to a string, something definitely goes wrong. Is that a correct response to a float correct?

Reproducible in:

Python 3.8.0
slackclient==2.9.1

Steps to reproduce:

...

rs = web_client.chat_postMessage(channel=SLACK_CHANNEL, text="test msg")  # assume that it's Ok.
print(rs['ts'])  # "1602167511.000300"

# Correct usage
rs = web_client.chat_postMessage(channel=SLACK_CHANNEL, text="thread test", thread_ts="1602167511.000300")
print(rs.data)  # this will show that response is Ok

# Bad timestamp
rs = web_client.chat_postMessage(channel=SLACK_CHANNEL, text="thread test", thread_ts=1602167511.000300)
print(rs.data)  # this will show that response is Ok as well 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Version: 2xVersion: 3xdiscussionM-T: An issue where more input is needed to reach a decisionneeds infoAn issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more infoquestionM-T: User needs support to use the projectweb-client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions