This post documents an obscure issue I discovered relating to the Salesforce Streaming API after switching to the new Lightning user interface.
For several years now at work we’ve had an integration that uses the Salesforce Streaming API to sync customer and contact information from Salesforce to an on-premise system. Recently after some users transitioned to the new Lightning user interface, the integration stopped working.
On investigation, it turned out to be related to field permissions. One of the fields configured in the PushTopic was a formula field. The permissions on this formula field were set to make it readable by only Administrators and the Integration user.
- When using the Salesforce classic interface, if another user (who did not have read permission on the formula field) updated a record, the formula field value appeared in the streaming event
- When using the Lightning interface, if another user (who did not have read permission on the formula field) updated a record, the formula field value did not appear in the streaming event.
As this formula field was a required value in our integration, the fact that it was missing caused the integration to break. The simple solution was to make this formula field readable by all users.
In summary, there seems to be a subtle change in the behaviour of the Streaming API between Classic and Lightning interfaces. The following is not an authoritative statement, but from my testing it appears that …
- In the Classic interface, the fields available in the streaming event are determined by the permissions of the user subscribing to the PushTopic channel.
- In Lightning, the fields available in the streaming event are determined by the permissions of the user generating the event.