Skip to content

Commit 36f0039

Browse files
bbrands02claude
andcommitted
feature: port shouldTriggerOnEvent guard to handleObjectEventSynchronization
Adds the missing shouldTriggerOnEvent check in both the direct and triggered synchronizations loops, so only synchronizations configured for the current mutation type are executed on object events. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 72e70ea commit 36f0039

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lib/Service/SynchronizationService.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,24 @@ public function handleObjectEventSynchronization(ObjectEntity $object, string $e
171171

172172
$directSynchronizations = $this->findAllBySourceId(register: $register, schema: $schema);
173173
foreach ($directSynchronizations as $synchronization) {
174+
if ($this->shouldTriggerOnEvent($synchronization, $eventMutationType) === false) {
175+
continue;
176+
}
174177
try {
175178
if ($eventMutationType === 'delete') {
179+
$eventObject = $object;
176180
$this->synchronize(
177181
synchronization: $synchronization,
178182
force: true,
179-
object: $object,
183+
object: $eventObject,
180184
mutationType: 'delete'
181185
);
182186
} else {
187+
$eventObjectArray = $objectArray;
183188
$this->synchronize(
184189
synchronization: $synchronization,
185190
force: true,
186-
object: $objectArray
191+
object: $eventObjectArray
187192
);
188193
}
189194

@@ -208,6 +213,9 @@ public function handleObjectEventSynchronization(ObjectEntity $object, string $e
208213
if (in_array($synchronization->getId(), $processedSynchronizationIds, true) === true) {
209214
continue;
210215
}
216+
if ($this->shouldTriggerOnEvent($synchronization, $eventMutationType) === false) {
217+
continue;
218+
}
211219

212220
try {
213221
$parentObjectArray = $this->resolveParentObjectForRelatedObjectTrigger(

0 commit comments

Comments
 (0)