Add reason tracking to disallowPush() and disallowPull() event methods

Created on 27 August 2025, 2 months ago

Currently, the SalesforcePushAllowedEvent::disallowPush() and SalesforcePullEvent::disallowPull() methods only allow blocking operations without
providing context about why they were blocked. This makes debugging and logging difficult when multiple event subscribers might be involved.

Proposed changes

Add optional array $reasons = [] parameter to both disallowPush() and disallowPull() methods
Add getReasons() method to both event classes to retrieve the accumulated reasons
Store reasons in a protected $reasons property that gets merged when multiple subscribers add reasons

Example usage

  // In an event subscriber
  $event->disallowPush(['Entity is archived', 'Missing required field']);

  // Later, for debugging/logging
  $reasons = $event->getReasons();
Feature request
Status

Active

Version

5.1

Component

salesforce_pull.module

Created by

🇮🇱Israel amitaibu Israel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024