feat: track cache changes with sequence numbers and tombstones

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-10-07 21:21:14 -04:00
parent c20dde6633
commit eea9b5630a
10 changed files with 511 additions and 46 deletions
+4 -2
View File
@@ -128,16 +128,18 @@ final class CacheSerializationTest extends TestCase
->with(
['sid' => 'svc', 'mailbox' => 'INBOX', 'uidValidity' => 7, 'uid' => 42],
$this->callback(function (array $update): bool {
$this->assertSame(['$set'], array_keys($update));
$this->assertSame(['$set', '$setOnInsert'], array_keys($update));
$this->assertSame('tenant', $update['$set']['tid']);
$this->assertSame(7, $update['$set']['uidValidity']);
$this->assertSame(5, $update['$set']['modSeq']);
$this->assertSame(['addedSeq' => 5], $update['$setOnInsert']);
$this->assertArrayNotHasKey('blobs', $update['$set']);
return true;
}),
['upsert' => true],
);
(new MessageStore($this->dataStore($collection)))->upsert('tenant', 'svc', 7, $this->entity());
(new MessageStore($this->dataStore($collection)))->upsert('tenant', 'svc', 7, $this->entity(), 5);
}
public function testMailboxStoreUpsertLeavesHarmonizationState(): void