Skip to content

fix(messages): extract text from legacy attachments/blocks when content is empty - #18

Open
nulligence wants to merge 2 commits into
Nullify-Platform:mainfrom
nulligence:fix/slack-cli-attachments-content
Open

nulligence wants to merge 2 commits into
Nullify-Platform:mainfrom
nulligence:fix/slack-cli-attachments-content

Conversation

@nulligence

@nulligence nulligence commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex

Attachment-only and Block Kit-only Slack messages returned empty CLI content.

  • Extract attachment fields and nested or top-level block text when plain text is empty; retain plain-text and attachment precedence.
  • Exercise the nested attachment fallback with empty text, nonempty text precedence, context/rich-text sections and mixed attachment/block messages.

Focused Slack message rendering package with race detection passed on office server 2 at 33fb919.

Correctness confidence: 85% from source inspection; focused remote Go checks passed. Merge risk: low for the rendering fallback; deployment risk is limited to messages previously rendered empty. The repository’s require-labels check passed with the required patch label.

…is empty

Bot integrations that post via legacy Slack "attachments" or top-level
Block Kit "blocks" (Grafana alerts, threat-investigation bots, etc.)
often never populate the plain "text" field. parseRawMessage only ever
read raw["text"], so message list/get returned an empty content string
for these posts even though the full alert/body was present in
attachments[].text/.fallback/.title/.fields or blocks[].text.text —
forcing a manual curl fallback against conversations.history to recover
the content.

Fall back to extracting human-readable text from attachments (including
attachments that carry nested Block Kit content instead of legacy
fields) and then from top-level blocks, only when "text" is empty, so
normal messages are unaffected.
@tim-thacker-nullify

Copy link
Copy Markdown
Member

Codex

Keep open for merge preparation: main still returns empty content for attachment-only and Block Kit-only messages.

  • internal/slack/messages.go:387-395 adds a fallback only when plain text is empty, preserving existing plain-text output and the body limit.
  • Add an empty-text nested-attachment-block regression: TestParseRawMessage_AttachmentNestedBlocks supplies non-empty text and therefore never exercises the fallback it is intended to cover. Include a rich-text context case and a message carrying both attachment and top-level blocks to define precedence.
  • The latest require-labels check is failing; satisfy this repository’s actual check before merge.
  • Estimated correctness confidence: 83%; merge risk: low after focused checks. Static source review only; Go tests were not run here. Deployment risk is limited to message rendering, and messages with non-empty fallback/stub text still intentionally omit attachment details.

@tim-thacker-nullify tim-thacker-nullify added the patch Patch version updates (fixes) label Nov 8, 2026
@tim-thacker-nullify

Copy link
Copy Markdown
Member

Codex

  • 33fb919 test(messages): exercise nested attachment and rich text fallback
    internal/slack/messages_test.go | 50 ++++++++++++++++++++++++++++++++++++-----
    1 file changed, 45 insertions(+), 5 deletions(-)
    .

Pushed fix: 33fb919.

Focused remote Go/rule checks remain pending. The description records the current confidence and merge/activation risks; remaining current-base integration and required checks still apply.

@tim-thacker-nullify

Copy link
Copy Markdown
Member

Codex

Focused Slack message rendering package with race detection passed on office server 2 at 33fb919.

The tested snapshot tree matched pushed commit 33fb919. Broader integration, overlapping-branch reconciliation and required checks remain where listed in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Patch version updates (fixes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants