Fix event firing on txn ops

This commit is contained in:
Jake Barnby 2025-11-12 16:48:26 +13:00
parent ab5aac00c4
commit ae21fadf0d
9 changed files with 19 additions and 1 deletions

View file

@ -152,6 +152,8 @@ class Decrement extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually decrementing
$groupId = $this->getGroupId();
$mockDocument = new Document([

View file

@ -152,6 +152,8 @@ class Increment extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually incrementing
$groupId = $this->getGroupId();
$mockDocument = new Document([

View file

@ -150,6 +150,8 @@ class Delete extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually deleting documents
$response->dynamic(new Document([
$this->getSDKGroup() => [],

View file

@ -174,6 +174,8 @@ class Update extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually updating documents
$response->dynamic(new Document([
$this->getSDKGroup() => [],

View file

@ -149,6 +149,8 @@ class Upsert extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually upserting documents
$response->dynamic(new Document([
$this->getSDKGroup() => [],

View file

@ -412,6 +412,8 @@ class Create extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually creating documents
if ($isBulk) {
$response->dynamic(new Document([

View file

@ -176,6 +176,8 @@ class Delete extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually deleting document
$response->noContent();
return;

View file

@ -243,7 +243,6 @@ class Update extends Action
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1))
->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations);
// Handle transaction staging
if ($transactionId !== null) {
$transaction = ($isAPIKey || $isPrivilegedUser)
@ -302,6 +301,9 @@ class Update extends Action
...$document->getArrayCopy(),
...$data
]);
$queueForEvents->reset();
$response
->setStatusCode(SwooleResponse::STATUS_CODE_OK)
->dynamic($mockDocument, $this->getResponseModel());

View file

@ -302,6 +302,8 @@ class Upsert extends Action
);
});
$queueForEvents->reset();
// Return successful response without actually upserting document
$groupId = $this->getGroupId();
$mockDocument = new Document([