From 674011366368dde9309dd542b4828a3859f423da Mon Sep 17 00:00:00 2001 From: Simon Dumas Date: Tue, 19 Nov 2024 17:10:05 +0100 Subject: [PATCH] Decrement revision on update for tagged resolvers --- .../nexus/ship/resolvers/ResolverProcessor.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/resolvers/ResolverProcessor.scala b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/resolvers/ResolverProcessor.scala index de6c4d0092..c30589b549 100644 --- a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/resolvers/ResolverProcessor.scala +++ b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/resolvers/ResolverProcessor.scala @@ -49,12 +49,16 @@ class ResolverProcessor private ( case ResolverUpdated(_, _, value, _, _, _, _) => implicit val caller: Caller = Caller(s, identities(value)) val patched = patchValue(value, projectMapper, iriPatcher) - resolvers.update(id, projectRef, cRev, patched) + resolvers.update(id, projectRef, cRev, patched).recoverWith { case IncorrectRev(_, expectedRev) => + resolvers.update(id, projectRef, expectedRev, patched) + } case _: ResolverTagAdded => // Tags have been removed IO.unit case _: ResolverDeprecated => - resolvers.deprecate(id, projectRef, cRev) + resolvers.deprecate(id, projectRef, cRev).recoverWith { case IncorrectRev(_, expectedRev) => + resolvers.deprecate(id, projectRef, expectedRev) + } } }.redeemWith( {