Breaking changes
-
ButtonBlockElementis no longer comparable becauseVisibleToUserIDsis a slice.
Value comparisons and map keys using it no longer compile; interface comparisons containing button values can panic. Use comparable identifiers as map keys and compare button contents explicitly:// Before same := a == b // After (import "reflect") same := reflect.DeepEqual(a, b)
-
If you create these structs without naming their fields, update that code. New fields were added to Block Kit elements,
Attachment,File,RemoteFileandFeatures. Code that supplies values by position now fails to compile. Include the field names, or use the existingNew...helper functions where available:// Before: values depend on field order. element := slack.RichTextSectionBroadcastElement{slack.RTSEBroadcast, "here"} // After: each value names its field. element := slack.RichTextSectionBroadcastElement{ Type: slack.RTSEBroadcast, Range: "here", }
-
Newly supported rich-text elements decode into concrete types instead of
*RichTextSectionUnknownElement. Update type assertions and switches for attachment, workflow, Work Object and message mentions; tags; canvas elements; citations; file and List record references; and Salesforce data fields. -
Request signature validation is stricter, and mismatch errors have changed.
NewSecretsVerifierrejects signatures without thev0=prefix or whose decoded length is not 32 bytes. Update any test fixtures that relied on the previous permissive parsing.SecretsVerifier.EnsurereturnsErrInvalidSignatureon a mismatch; replace checks of the old error text witherrors.Is(err, slack.ErrInvalidSignature). -
UninstallAppandRotateTokensnow use POST, including theirContextvariants. Update mocks or custom transports that expect GET requests or credentials in the URL to accept form-encoded POST bodies. -
OptionOnWarningcallbacks no longer receive thetokenparameter in form or query parameter maps. Update callbacks that rely on that field.
Added
-
Add
RTMOptionReadLimitandsocketmode.OptionReadLimitto limit incoming WebSocket message sizes on every connection, including reconnects. The default remains unlimited; exceeding a configured limit closes the connection and triggers normal reconnect handling. With compression enabled through a custom dialer, the limit counts compressed bytes and does not bound the size after decompression. -
Block Kit: Add typed Salesforce data fields with record IDs, field metadata, label visibility, and styles. These now decode into
RichTextSectionSalesforceDataFieldElementinstead ofRichTextSectionUnknownElement.[!WARNING]
has_withheld_salesforce_field_namesis based on live Slack responses and is absent from the reference and SDK models. -
Block Kit: Add typed workflow mentions with workflow and trigger IDs, display text, URLs, message locations, and styles. These now decode into
RichTextSectionWorkflowMentionElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add typed Work Object mentions with entity and app IDs, display text, URLs, icons, preview settings, product names, and styles. These now decode into
RichTextSectionWorkObjectMentionElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add typed attachment mentions with app, entity, icon, message, preview, and product metadata. These now decode into
RichTextSectionAttachmentMentionElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add typed rich-text tags with styles and constants for all nine colors. Tags now decode into
RichTextSectionTagElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add typed List record references with record and view IDs, display text, URLs, and styles. These now decode into
RichTextSectionListRecordElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add typed canvas user mentions and canvas message unfurls, including thread IDs and styles. These now decode into concrete types instead of
RichTextSectionUnknownElement. -
Block Kit: Add typed canvas rich-text elements with labels, section links, title visibility, styles, and skill metadata. These now decode into
RichTextSectionCanvasElementinstead ofRichTextSectionUnknownElement. -
Block Kit: Add
RichTextSectionCitationElementwith typed file, external, web, message, and memory details for rich-text citations. Preserve unknown detail variants as raw JSON. Citations now decode into this concrete type instead ofRichTextSectionUnknownElement. -
Block Kit: Add typed file
and message mention
rich-text elements, including styles and optional metadata. These now decode into concrete
types instead ofRichTextSectionUnknownElement. -
Add image alt text, GIF, PDF, 800px and inline thumbnails, audio and transcription metadata, preview truncation, remote file identifiers, canvas and List metadata, title blocks, and sharing and app metadata to
File. Preserve sharing and app metadata inRemoteFileresponses. -
Block Kit: Add missing element fields for button accessibility, agent prompts, visibility, conversation selection, rich-text input sizing, and rich-text styles and metadata, including shared emoji URLs.
-
Add
IsShare,IsMsgUnfurlandFilestoAttachment, so the files of a forwarded message are decoded rather than dropped. -
Add
CreateAgentConversationandArchiveAgentConversation(plusContextvariants) foragents.conversations.createandagents.conversations.archive. -
Add
SetAgentConversationCommands(plusContextvariant) andFeatures.CodeChannelsfor agent slash commands. -
Add all 12 Slack Lists API methods, with
Contextvariants and scoped options for lists, access, items, and exports. -
Block Kit: Add
DataTableActionCellfor buttons indata_tableblocks, with an optionalraw_textorraw_numberfallback (#1618). -
Add
AdminAppsApprovedListandAdminAppsRestrictedList(plusContextvariants) for theadmin.apps.approved.listandadmin.apps.restricted.listmethods, with typed app, scope and pagination responses (#1614). -
Add
AdminAppsRequestsList(plusContextvariant) for theadmin.apps.requests.listmethod, with typed request and pagination responses (#1615). -
Filenow unmarshals the video fields of the file object: the video thumbnail (ThumbVideo,ThumbVideoW,ThumbVideoHandThumbVideoTimestamp) andDurationMs,HLS,HLSEmbed,HLSPreview,MediaDisplayType,MP4,MP4LowandVTT.
Fixed
- RTM: Keep reader errors scoped to their connection and stop the old reader before reconnecting, so stale errors cannot close the next connection.
slackevents.ParseEventreturns an error for anevent_callbackwith a missing or null innereventinstead of panicking.- Release multipart upload writers when a request fails or returns before consuming the request body.
Full Changelog: v0.30.1...v0.31.0