Newer Version Available

This content describes an older version of this product. View Latest

Only Last PushTopic Notification Sent for the Same Record

In API version 36.0 and earlier, when multiple PushTopic notifications are generated for the same record within about one millisecond and in the same transaction, only the last notification is sent.

The other notifications are suppressed because notifications are tracked at the millisecond level. When multiple notifications happen within a transaction at the same time—less than one millisecond—only the last notification can be delivered.

For example, let’s say you have a PushTopic for insertions and updates of contact records, and the PushTopic query selects fieldA. If a contact is inserted and then an Apex trigger or workflow updates fieldA within a short time, only the notification for the update is sent. A notification isn’t sent for the contact creation.

However, if the elapsed time between the notifications is over one millisecond, all notifications are sent for the same record, and no notification is suppressed.

To learn more about transactions, see Apex Transactions in the Apex Developer Guide and Flows in Transactions in the Salesforce Help.

In API version 37.0 and later, notifications are tracked by a unique ID and don’t depend on the time when they were generated. All notifications for the same record within one transaction are sent, and notifications aren’t suppressed.

Note