Fix Slack connector float timestamp causing messages to be deleted on scheduled syncs (#3032)#3997
Conversation
|
💚 CLA has been signed |
|
buildkite test this |
|
Thanks for the contribution, @sukhadagholba! In order for us to accept it, you'll need to sign the Contributor License Agreement with the same email address you use for your Github user. |
|
buildkite test this |
1 similar comment
|
buildkite test this |
@seanstory Thank you, just signed the Contributor License Agreement |
|
buildkite test this |
|
@seanstory - I see that the CLA check appears to be failing, do I need to re-sign the Contributor License Agreement or does the check take a bit to pass? |
|
I would have expected it to re-trigger. Looking closer, this has to do with commits, and it looks like your commits are made by You may need to fix some local git config and rebase to re-write the history to be associated with your github user. |
0c22469 to
2d25fb9
Compare
|
Thank you @seanstory ! Fixed the issue, CLA checks seem to pass now. |
|
buildkite test this |
time.time() returns a float with decimal places which causes the Slack conversations.history API to return no messages. Truncating to int fixes the issue. Fixes elastic#3032
Head branch was pushed to by a user without write access
2d25fb9 to
8cb9280
Compare
|
@seanstory Synced branch with latest main to resolve the out-of-date warning. Could you please re-enable auto-merge? Thanks! |
|
buildkite test this |
|
@sukhadagholba looks like the linter is failing. Should be as easy as running |
Head branch was pushed to by a user without write access
@seanstory Done! Thank you! |
|
buildkite test this |
There was a problem hiding this comment.
@sukhadagholba I expect that you generated this after having installed test dependencies. I'm pretty sure CI will undo all the additions, but just gonna mark this as "request changes" to make sure we don't merge +15k additions here.
There was a problem hiding this comment.
Good catch @seanstory !
Also, is it normal for PR to have an issue number as part of the PR name?
There was a problem hiding this comment.
is it normal for PR to have an issue number as part of the PR name?
It's not abnormal. But we don't have a strong policy about how you associate a PR with an issue, as long as you do.
I'm pretty sure CI will undo all the additions
Doesn't look like it did, and I expect that's because our bot can't push commits to your fork. So, @sukhadagholba can I ask you to:
- delete this NOTICE.txt
make clean notice- commit the NOTICE changes
- push
?
There was a problem hiding this comment.
@seanstory Done! Deleted NOTICE.txt, ran make clean notice, committed and pushed the changes.
|
buildkite test this |
💔 Failed to create backport PR(s)
To backport manually run: |
Closes #3032
Problem
time.time()in Python returns a float with decimal places (e.g.1745123456.561659).These float timestamps are passed directly to the Slack
conversations.historyAPIas
oldestandlatestparameters.The Slack API inconsistently rejects decimal timestamps — returning no messages when
decimals are present, despite the docs showing decimal format in examples. This causes
the connector to successfully sync all messages on the first manual full sync, but all
subsequent scheduled syncs return no messages and only sync users, permanently deleting
all previously indexed messages until another manual full sync is triggered.
This issue was first reported in December 2024. As of April 2026, 16 months later,
Slack has not resolved the inconsistent API behavior, making this connector-side
fix necessary to unblock users. While the root cause may lie in inconsistent Slack
API behavior, this defensive fix on the connector side ensures reliable syncing
regardless of whether Slack resolves the inconsistency on their end.
Fix
Truncate float timestamps to
intbefore passing to the Slack API:Testing
Applied this fix to the
v9.1.4tag and tested against Elasticsearch 9.1.4:Messages are no longer deleted on scheduled syncs confirming the fix works as expected.
Checklists
Pre-Review Checklist
test_channels_and_messages_uses_integer_timestampswhich directly validates the fix