Huge thank you to Michal Mazurek (@akfaew) for submitting a bunch of patches for this
release.
Breaking changes — read before upgrading
Warning
v0.34.0 includes breaking API, decoding, serialization, and event-dispatch changes.
Your code may fail to compile. Code that still compiles may decode, serialize,
or route events differently. Malformed payloads can cause an entire Events API
event to be rejected.
Review every item below before upgrading, including interfaces, mocks, custom
event decoders, and stored payloads.
1. Retired user APIs have been removed
SetUserAsActiveandSetUserAsActiveContextare gone. Remove these calls.
SetUserPresencestill supportsawayandauto, but marking user as active is gone.GetUsersOptionPresenceis gone. Remove it fromGetUsers,GetUsersContext,
andGetUsersPaginatedcalls. User-list requests no longer send the retired
presenceparameter. UseGetUserPresenceorGetUserPresenceContextfor
individual presence checks.
2. Team-info method signatures have changed
GetTeamInfo, GetTeamInfoContext, GetOtherTeamInfo, and
GetOtherTeamInfoContext now accept ...GetTeamInfoOption. Update interfaces,
mocks, and assigned function types to include the variadic parameter. Existing
direct calls remain valid.
3. Auth-provider blocks have a new concrete type and lose raw JSON
Note
This is a brand new block. For now experimental as it doesn't yet appear in the slack
docs but is already part of their official node sdk.
auth_providerblocks now decode as*AuthProviderBlock, replacing
*UnknownBlock. Update type assertions and type switches.
An unchanged JSON round trip is no longer guaranteed. Marshaling drops unknown
fields, adds zero values for absent required fields, and can omit explicit nulls
or empty optional values. Keep the original payload if you need to preserve its JSON.
4. Stricter decoding can reject whole events or manifests
Values that were previously ignored or accepted can now return errors:
- Input blocks: malformed input elements fail decoding of the input block and
its containingBlocks. Missing elements and JSONnullinput retain their
previous behavior. - Auth-provider blocks: malformed known fields, such as
"name":42, fail
decoding of the containingBlocks. - Messages: malformed
display_as_botvalues, such as"false",0,[], or
{}, fail message decoding. Missing andnullvalues remain accepted.
Marshaling now emits explicittrueandfalsevalues that were previously
discarded.
A malformed message or block can cause slackevents.ParseEvent to reject the
entire event, preventing its delivery to your handler. Check error handling and
any captured payloads you replay.
5. Positional struct literals no longer compile
New fields in Features, TeamInfo, Msg, and Tab break positional literals for
these types. Use keyed literals with field names. Existing keyed literals
remain valid.
6. Built-in user-connection decoders take precedence
The built-in user_connection and user_connection_status_requested decoders take
precedence over custom entries in slack.EventMapping. Register custom decoders
for these events in slackevents.EventsAPIInnerEventMapping.
7. Socket Mode dispatch changes for envelopes without inner events
Empty-string event handlers no longer receive these envelopes. Register
handlers by the outer event type, for example
HandleEvents(slackevents.AppRateLimited, handler) for app_rate_limited.
A matching outer-type handler can now suppress the default handler. Check
applications that relied on the default handler receiving these envelopes.
Added
-
Add
GetCanvasContentandGetCanvasContentContext, with optional Markdown or
HTML output. Slack API reference. -
Add
GetTeamInfoOptionIncludeSlackbotAvailabilityand
TeamInfo.SlackbotAvailabilityfor advisory workspace availability.
Slack API reference. -
Add
RequestUserConnectionAuth,BulkUpdateUserConnections, their context
variants, and per-user bulk-update failures. AddAuthProviderBlock, the
user_connectionanduser_connection_status_requestedevents, and manifest
features.user_connections. The authentication APIs, status-requested event,
and manifest configuration follow the official Node SDK schemas; their standalone
reference pages were unavailable when added.
AuthProviderBlocksupport is experimental:auth_provideris not live in Slack
yet. This implementation uses the official Node SDK as a guide. Its schema and
behavior may change when Slack releases the block.
Node SDK release,
auth provider schema,
user connection event. -
Configure RTM WebSocket handshake headers with
RTMOptionDialHeaders.
Headers are copied and reused on reconnect; existing defaults remain unchanged. -
Decode
data.file_idon channel tabs asTab.Data.FileID, so the tab that
shows a given canvas can be identified fromconversations.info. Preserve
absentdataandfile_idfields when marshaling tabs.
Changed
- Document the undocumented preference endpoints and authentication limits of
GetUserPrefs,GetUserPrefsContext,MuteChat, andUnMuteChat. The mute
helpers use the legacymuted_channelspreference, which may differ from the
current client's notification settings.
Removed
-
Breaking: Remove
SetUserAsActiveandSetUserAsActiveContext, which called
the non-functionalusers.setActiveendpoint. Remove these calls from clients;
SetUserPresencestill supportsawayandauto, but neither forces a user active.
Slack retired this endpoint in 2018; see its
retirement notice. -
Breaking: Remove
GetUsersOptionPresenceand stop sending the retired
presenceparameter onusers.listrequests. Remove that option fromGetUsers,
GetUsersContext, andGetUsersPaginatedcalls. UseGetUserPresenceor
GetUserPresenceContextwhen individual presence information is needed.
Slack retired these features in 2018; see its
retirement notice.
Fixed
-
Remove the requested channel from the legacy muted-channel preference in
UnMuteChat. Skip updates when the channel is already unmuted, without panicking. -
Honor
ListTeamsParameters.LimitinListTeamsandListTeamsContextrequests. -
Encode multiple user IDs as a comma-separated list in
MigrationExchangerequests. -
Omit unset
TimestampToandLimitparameters inListRemoteFilesand
ListRemoteFilesContext, so Slack can apply its defaults. -
Preserve optional
display_as_botvalues in messages, including thread
broadcasts, asMsg.DisplayAsBot. Use a pointer to distinguish false from an
absent field. The remaining thread-broadcast fields already decode through
slackevents.MessageEvent.Message.
Node SDK change. -
Route Events API envelopes without an inner event, such as
app_rate_limited,
to handlers registered for the outer event type in Socket Mode. -
Reject request timestamps so far in the future that the duration difference
overflows, instead of allowing them to pass the five-minute timestamp check. -
Decode confirmation dialogs, options, and option groups in
BlockObjects
using their documented object and array fields instead of silently dropping them.
Slack composition objects. -
Decode
internal_team_idsin EKM original connected channel responses instead
of looking forinternal_team_ids_count.
Slack API reference. -
Honor the
Typesfilter inListFilesandListFilesContextrequests.
Slack API reference. -
Send the requested Y crop coordinate in user photo uploads.
-
Preserve the initial pagination state after failed conversations and stars
requests, so a rate-limited first page is retried instead of reporting an
empty successful result. -
Return Slack API errors from starred-item pagination rather than silently
treating them as the end of the list. -
Synchronize RTM connection-info reads with reconnect updates.
-
Reconnect RTM connections on permanent WebSocket read errors instead of
retrying until Gorilla WebSocket panics on a truncated stream. Continue
tolerating empty or incomplete JSON messages on healthy connections. -
Deliver warnings from user-profile and event-authorization requests.
-
Avoid a nil-pointer panic when decoding a
nullconversation-kick response. -
Honor the configured API endpoint in
SetUserCustomFieldsand
SetUserCustomFieldsContext. -
Preserve error causes in legacy admin helpers and Events API parsing, and
recognize wrapped rate-limit, pagination, and RTM errors. -
Accept valid non-ASCII text in
TextBlockObject.Validateby counting Unicode
code points for the 3000-character limit. -
Return custom option errors from
FunctionCompleteSuccessand
FunctionCompleteSuccessContextbefore sending a request. -
Return decoding errors for malformed input elements from
InputBlock.UnmarshalJSONandBlocks.UnmarshalJSON. Missing elements and
JSONnullinput retain their previous decoding behavior.
Full Changelog: v0.33.0...v0.34.0