[Fix] Log discarded automated Slack messages that mention other users - #1700
Open
mrubens wants to merge 1 commit into
Open
[Fix] Log discarded automated Slack messages that mention other users#1700mrubens wants to merge 1 commit into
mrubens wants to merge 1 commit into
Conversation
Automated (app/bot-authored) Slack messages that mention users without mentioning the installed Roomote bot are discarded by design, but the drop was completely silent. This hid real misconfigurations, e.g. a Slack workflow whose message template still mentions the bot user of a previous Roomote installation (Slack renders the stale mention identically to a live one). Add an info-level log in the webhook discard branch naming the mentioned user IDs and the installed bot user ID so these cases are diagnosable from api logs.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Automated (app/bot-authored) Slack
messageevents that mention users without mentioning the installed Roomote bot are discarded by design, but the discard was completely silent. The webhook now emits an info-level log naming the mentioned user IDs, the installed bot user ID, and the event's channel/ts/subtype/app_id/bot_id before dropping such an event.Why this change was made
The silent drop hid real misconfigurations. Concretely: a Slack Workflow Builder message template can carry a mention token for the bot user of a previous Roomote installation. Slack renders the stale mention identically to a live one (a blue @roomote), so the workflow looks correct while its mentions reach a deleted bot user and Roomote never reacts. Diagnosing this required manually fetching message payloads from the Slack API; with this log line it is visible directly in api logs, including the exact stale user ID.
Routing behavior is intentionally unchanged: automation still only engages Roomote via an explicit mention of the currently installed bot user (or configured channel auto-start). This PR only makes the existing discard observable.
Impact
No behavior change for routing, task launch, or replies. Operators debugging "Roomote ignored an automated mention" reports can now find a log line identifying which user IDs were mentioned instead of the installed bot user.
Focused coverage: unit tests for the new log helper, including the real-world workflow payload shape (
bot_message+app_id+ stale mention), plus null cases for bot-mentioning, mention-free, Roomote-authored, and non-message events.