From 609b1598c886904c4358c990be236a35bfc7cb34 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 24 Mar 2026 14:10:32 +0100 Subject: [PATCH] Revert change. --- .../Infrastructure/MongoExtensions.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/backend/src/Squidex.Data.MongoDb/Infrastructure/MongoExtensions.cs b/backend/src/Squidex.Data.MongoDb/Infrastructure/MongoExtensions.cs index e06b86713..2a3801771 100644 --- a/backend/src/Squidex.Data.MongoDb/Infrastructure/MongoExtensions.cs +++ b/backend/src/Squidex.Data.MongoDb/Infrastructure/MongoExtensions.cs @@ -177,20 +177,6 @@ public static class MongoExtensions var result = await collection.ReplaceOneAsync(filter, job.Value, UpsertReplace, ct); - if (result.IsAcknowledged && result.ModifiedCount == 0 && oldVersion > EtagVersion.Any) - { - var existingVersion = - await collection.Find(filters.Eq("_id", key)) - .Project(Builders.Projection.Include("_id").Include(versionField)) - .FirstOrDefaultAsync(ct); - - var currentVersion = existingVersion != null - ? existingVersion[Field.Of(x => nameof(x.Version))].AsInt64 - : EtagVersion.Any; - - throw new InconsistentStateException(currentVersion, oldVersion); - } - return result.IsAcknowledged && result.ModifiedCount == 1; } catch (MongoWriteException ex) when (ex.WriteError?.Category == ServerErrorCategory.DuplicateKey)