Fix issue with Replace document method when adding and deleting a document in the same batch

This commit is contained in:
Louis Dureuil 2024-11-13 22:09:36 +01:00
parent 8e5b1a3ec1
commit 40dd25d6b2
No known key found for this signature in database

View File

@ -310,10 +310,10 @@ impl MergeChanges for MergeDocumentForReplacement {
} }
Some(InnerDocOp::Deletion) => { Some(InnerDocOp::Deletion) => {
return if is_new { return if is_new {
Ok(None)
} else {
let deletion = Deletion::create(docid, external_doc); let deletion = Deletion::create(docid, external_doc);
Ok(Some(DocumentChange::Deletion(deletion))) Ok(Some(DocumentChange::Deletion(deletion)))
} else {
Ok(None)
}; };
} }
None => unreachable!("We must not have empty set of operations on a document"), None => unreachable!("We must not have empty set of operations on a document"),