Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More updates to the message checker #604

Merged
merged 2 commits into from
Oct 2, 2024
Merged

More updates to the message checker #604

merged 2 commits into from
Oct 2, 2024

Conversation

rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Oct 2, 2024

It seems like slack's search sometimes takes a while to pick up certain messages.
E.g. this message from Rich didn't get SOS'd when he posted it. When I tried searching slack (in the UI, not with the API) a few minutes after the message was posted, it wasn't returning it in the search results when I searched using the BennettBot message checker query. It only came up if I also explicitly put from:@<rich> into the query.

However, this morning the search UI (and the API) are returning that message. So, I think some messages slip through the cracks somehow, don't get sent to our slack bolt app, and also don't get returned in search results. But they do get picked up some time later. Rich's message was sent at 9:30pm, and the message checker was only checking messages from the same day, so it only had a couple of hours to get through. This PR makes it check for all of yesterday AND today, to give it more of a chance to find them.

Also drive-by fixes:

  • no need to use a "before" parameter to search; "after" on its own will search up until now
  • wrap the keyword in double quotes so we only find exactly "tech-support" (with hyphen)

This prevents searches from returning messages that include
"tech support" rather than the magic keyword "tech-support" (with
the hyphen).
Slack only allows us to search from a date, not a datetime (times
can be used too, but they apply to times on every day).

Sometimes, it seems slack's search just doesn't return messages
for a while. We now make it check for the whole of yesterday
AND today.

We also don't need to give it a "before" search term.
@rebkwok rebkwok merged commit e38b83a into main Oct 2, 2024
6 checks passed
@rebkwok rebkwok deleted the check-more branch October 2, 2024 11:27
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.

2 participants