Skip to content

Commit

Permalink
Decrement revision on update for tagged resolvers (#5239)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Dumas <simon.dumas@epfl.ch>
  • Loading branch information
imsdu and Simon Dumas authored Nov 19, 2024
1 parent 566e436 commit 84f2cbf
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit 84f2cbf

Please sign in to comment.