Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -6365,6 +6365,9 @@ public function updateDocument(string $collection, string $id, Document $documen
return $document;
}

// Purge again after commit so readers cannot re-cache the pre-commit version
$this->purgeCachedDocumentInternal($collection->getId(), $id);
Comment thread
abnegate marked this conversation as resolved.
Comment thread
abnegate marked this conversation as resolved.
Comment thread
abnegate marked this conversation as resolved.
Comment thread
abnegate marked this conversation as resolved.

if (!$this->inBatchRelationshipPopulation && $this->resolveRelationships) {
Comment thread
abnegate marked this conversation as resolved.
$documents = $this->silent(fn () => $this->populateDocumentsRelationships([$document], $collection, $this->relationshipFetchDepth));
$document = $documents[0];
Expand Down Expand Up @@ -7751,6 +7754,8 @@ public function deleteDocument(string $collection, string $id): bool
});

if ($deleted) {
// Purge again after commit so readers cannot re-cache the pre-commit version
$this->purgeCachedDocumentInternal($collection->getId(), $id);
$this->trigger(self::EVENT_DOCUMENT_DELETE, $document);
}

Expand Down
Loading