From 8d497484ce4e66127b6a93d875d177246da6f3ac Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 16 May 2022 17:40:02 +0200 Subject: Prevent causal read for outbox message and recipient inserts The message and the recipients are inserted in one transaction but the recipients are read another time outside a transaction. Read-write split database clusters might not be in full sync mode and then reading the recipients gives partial or no results. The insert will assign the primary key value to the recipient entities. Therefore we can skip reading the data. Signed-off-by: Christoph Wurst --- tests/Integration/Service/OutboxServiceIntegrationTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/Integration') diff --git a/tests/Integration/Service/OutboxServiceIntegrationTest.php b/tests/Integration/Service/OutboxServiceIntegrationTest.php index cbfa17c13..9386f97ea 100644 --- a/tests/Integration/Service/OutboxServiceIntegrationTest.php +++ b/tests/Integration/Service/OutboxServiceIntegrationTest.php @@ -160,9 +160,7 @@ class OutboxServiceIntegrationTest extends TestCase { $this->assertNotEmpty($message->getRecipients()); $this->assertEmpty($message->getAttachments()); - $retrieved->resetUpdatedFields(); - $saved->resetUpdatedFields(); - $this->assertEquals($saved, $retrieved); // Assure both operations are identical + self::assertCount(1, $retrieved->getRecipients()); } public function testSaveAndGetMessages(): void { -- cgit v1.2.3