Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More

Considerations when using Lightning Console API Events for Enhanced Messaging with respect to Managing Cross-Tab Events

Publish Date: Aug 6, 2026
Description

The Lightning Console API provides specific message channels to react to messaging events.

  • lightning__conversationAgentSend
  • lightning__conversationEnded
  • lightning__conversationEndUserMessage

These subscriptions use APPLICATION_SCOPE (scope="APPLICATION" in Aura). Events are processed workspace-wide.

A single event triggered in one active tab broadcasts to all open tabs at the same time. Background instances of your custom component will also process the payload when a console user has multiple messaging sessions open.

As a result, background tabs can:

  • Update internal flags prematurely.
  • Clear states unexpectedly.
  • Execute automation against the wrong record context.
Resolution
To prevent cross-tab interference, custom components must validate that the incoming event payload matches the page record context. Add a validation check at the start of the event handler to compare the page record ID with the payload record ID. If they do not match, stop execution immediately.
 
Implementation examples:
Lightning Web Components (LWC): Use the @api recordId decorator and add a guard clause to the handler.
handleMessage(message) {
  // Stop execution if the event belongs to a different open tab
  if (this.recordId !== message.recordId) {
    return;
  }
  // Execute your custom logic here
}
Aura Components: Implement hasRecordId and add a validation check to the client-side controller.
onConversationEvent: function(component, event, helper) {
  var currentRecordId = component.get("v.recordId");
  var eventRecordId = event.getParam("recordId");

  // Stop execution if the event belongs to a different open tab
  if (currentRecordId !== eventRecordId) {
    return;
  }
  // Execute your custom logic here
}
Additional Resources

Please review the following Salesforce documentation links.

Knowledge Article Number

005388743

 
Loading
Salesforce Help | Article