Skip to content

Junior can't see Slack unfurl previews on inbound messages #416

@sentry-junior

Description

@sentry-junior

Problem

Slack generates link unfurl previews asynchronously. The initial message event arrives with an empty attachments array; the actual unfurl data is appended later via a message_changed event. Junior processes the original event, stores the plain text, and never revisits it — so unfurl content (e.g., Discord/GitHub link previews) is invisible even when clearly visible in the Slack UI.

The existing message_changed handler (ingress/message-changed.ts) only reacts to newly-added bot mentions, so unfurl-only updates are silently dropped.

Root cause

reply-executor.ts builds userText from message.raw.attachments at event-delivery time, before Slack has populated that field. The value is persisted as-is and never refreshed.

Fix

PR #415 adds a maybeRefetchSlackUnfurlAttachments helper that retries conversations.replies with short delays (≤ 2.5 s total) when the inbound raw has no attachments but the text contains a URL. The enriched attachment data is merged into the raw object before prepareTurnState finalises the turn text. The helper is a no-op for messages without URLs.

Action taken on behalf of Sergiy Dybskiy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions