slack: promote legacy-attachment content to message body text - #334
Open
Soony123 wants to merge 1 commit into
Open
slack: promote legacy-attachment content to message body text#334Soony123 wants to merge 1 commit into
Soony123 wants to merge 1 commit into
Conversation
Notification bots (GitHub's Slack app among them) post messages whose text is empty, with the content living only in legacy attachments (fallback/ pretext/title/text). Every ingestion path read m.text alone, so these messages were invisible end to end: the thread dispatch dropped them as empty unprompted input, the ambient judge filtered them out of its batch, and the conversation view rendered them as blank lines. A channel with an action-mode bot policy or standing orders aimed at such a bot could never fire, because the judged batch never contained the notification body. messageBodyText (message-gating) returns the text verbatim when present and otherwise composes the body from attachment content, preferring the richer pretext/title/text fields over the fallback summary. Applied at every ingestion site: both events.ts dispatches, mirror.ts surface ingestion, and conversation-view rendering (including thread openers). Verified against a live instance: a label-filtered GitHub PR notification in a channel with standing orders now reaches the ambient judge with its body visible and produces an engagement; before the change the same notification produced no judgment at all.
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.
Problem
Notification bots — GitHub's Slack app among them — post messages whose
textis empty, with the content living only in legacy attachments (fallback/pretext/title/text). Every ingestion path readm.textalone, so these messages were invisible end to end:(m.text ?? "").trim()), so anaction-mode bot policy or standing orders aimed at such a bot could never fire,Change
messageBodyText(inmessage-gating.ts, exported viaslack/lib.ts) returns the text verbatim when present and otherwise composes the body from attachment content, preferring the richerpretext/title/textfields over thefallbacksummary. Applied at every ingestion site: bothevents.tsdispatches,mirror.tssurface ingestion, andconversation-view.tsrendering (including thread openers).Verification
test/slack-message-gating.test.ts(verbatim text, fallback composition, multi-attachment join, field preference).text, post-change rows carry the attachment body.tsc --noEmit, eslint on touched files, and the slack message-gating/conversation/mirror test files all pass.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.