Making RTM presence subscription only
As of January 2018, presence_change
events are not dispatched without presence subscriptions established with presence_sub
. Relatedly, current user presence status is no longer communicated in rtm.start
. Learn more.
Beginning November 15, 2017, the RTM API's presence_sub
event will be available via presence subscription only.
Back in June, we introduced new ways to track user presence and the presence_change
event in the RTM API.
Dispatching presence events for all users in a workspace is an expensive operation for Slack. A flood of presence events from large workspaces can also disrupt your app's ability to process more useful, timely messages.
By subscribing only to the presence events your app needs to provide presence-dependent functionality, you can reduce unnecessary websocket traffic.
What's changing?
Slack will stop automatically dispatching presence_change
events over RTM websockets as user presence changes in a workspace.
To continue receiving presence_change
events you must:
- Enable presence subscriptions for your RTM streams by passing the
batch_presence_aware=1
argument tortm.start
orrtm.connect
. - Post
presence_sub
events to the websocket, noting which user IDs your app wants to track presence status for. - Consume the
users
array attached to batchedpresence_change
events, dispatched when presence changes for users your app is subscribed to.
In addition, rtm.start
will no longer include user presence
and online
field information in its initial preamble JSON. You'll need to use users.getPresence
to determine initial presence status instead.
What isn't changing?
Presence events are not currently issued as part of the Events API, therefore nothing is changing on the Events API.
What happens if I do nothing?
Your app will stop receiving presence_change
events on any websockets your app is connected to beginning November 15, 2017. If your app uses those presence events to direct functionality, your app might not do what it's supposed to do without that information.
Your app will no longer receive the current state of presence
and online
information for workspace users when connecting via rtm.start
.
When is this happening?
Presence subscriptions will become mandatory on November 15, 2017.
Please contact us if you have any concerns at feedback@slack.com.