diff --git a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs index da4beb8d7..9e60080fd 100644 --- a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs +++ b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs @@ -315,7 +315,16 @@ namespace Squidex.Infrastructure.Commands if (persistence.IsSnapshotStale) { - await persistence.WriteSnapshotAsync(Snapshot); + try + { + await persistence.WriteSnapshotAsync(Snapshot); + } + catch (Exception ex) + { + log.LogError(ex, w => w + .WriteProperty("action", "RepairSnapshot") + .WriteProperty("status", "Failed")); + } } } } diff --git a/backend/src/Squidex.Infrastructure/States/Persistence.cs b/backend/src/Squidex.Infrastructure/States/Persistence.cs index b4a2dbbe9..53a2abf60 100644 --- a/backend/src/Squidex.Infrastructure/States/Persistence.cs +++ b/backend/src/Squidex.Infrastructure/States/Persistence.cs @@ -46,7 +46,7 @@ namespace Squidex.Infrastructure.States public bool IsSnapshotStale { - get => persistenceMode == PersistenceMode.SnapshotsAndEventSourcing && versionSnapshot < versionEvents; + get => persistenceMode == PersistenceMode.SnapshotsAndEventSourcing && versionSnapshot < versionEvents && versionSnapshot > EtagVersion.Empty; } public Persistence(DomainId ownerKey, Type ownerType,