diff --git a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala index c00bf0087d..c42f4899b5 100644 --- a/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala +++ b/cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala @@ -85,9 +85,6 @@ object PresentBackgroundJobs extends BackgroundJobsHelper { ZIO .service[PresentationService] .flatMap(_.reportProcessingFailure(record.id, Some(ex))) - .catchAll(ex => - ZIO.logErrorCause(s"PresentBackgroundJobs - Fail to recover from ${record.id}", Cause.fail(ex)) - ) case ex => ZIO.logErrorCause(s"PresentBackgroundJobs - Error processing record: ${record.id}", Cause.fail(ex)) } .catchAllDefect(d => diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala index 7bdc865887..95f7a91aa0 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationService.scala @@ -169,6 +169,6 @@ trait PresentationService { def reportProcessingFailure( recordId: DidCommID, failReason: Option[Failure] - ): IO[PresentationError, Unit] + ): UIO[Unit] } diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala index 5f6ed6be39..bf23847f03 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceImpl.scala @@ -1101,7 +1101,7 @@ private class PresentationServiceImpl( override def reportProcessingFailure( recordId: DidCommID, failReason: Option[Failure] - ): IO[PresentationError, Unit] = + ): UIO[Unit] = presentationRepository.updateAfterFail(recordId, failReason) private def getRecordFromThreadId( diff --git a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala index 696b4dd5c3..cc622522e9 100644 --- a/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala +++ b/pollux/core/src/main/scala/org/hyperledger/identus/pollux/core/service/PresentationServiceNotifier.scala @@ -16,7 +16,7 @@ import org.hyperledger.identus.pollux.core.service.serdes.{AnoncredCredentialPro import org.hyperledger.identus.pollux.sdjwt.{HolderPrivateKey, PresentationCompact} import org.hyperledger.identus.pollux.vc.jwt.{Issuer, PresentationPayload, W3cCredentialPayload} import org.hyperledger.identus.shared.models.* -import zio.{IO, URLayer, ZIO, ZLayer} +import zio.{IO, UIO, URLayer, ZIO, ZLayer} import zio.json.* import java.time.Instant @@ -281,7 +281,7 @@ class PresentationServiceNotifier( override def reportProcessingFailure( recordId: DidCommID, failReason: Option[Failure] - ): IO[PresentationError, Unit] = svc.reportProcessingFailure(recordId, failReason) + ): UIO[Unit] = svc.reportProcessingFailure(recordId, failReason) } object PresentationServiceNotifier { diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationRepositorySpecSuite.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationRepositorySpecSuite.scala index 47bd53dda6..13c270c149 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationRepositorySpecSuite.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/repository/PresentationRepositorySpecSuite.scala @@ -427,7 +427,7 @@ object PresentationRepositorySpecSuite { exit <- repo.updatePresentationWithCredentialsToUse(record2.id, Option(Nil), newState).provide(wallet2).exit } yield assert(exit)(dies(hasMessage(equalTo("Unexpected affected row count: 0")))) }, - test("unable to updateAfterFail PresentationRecord outside of the wallet") { + test("updateAfterFail PresentationRecord outside of the wallet") { val walletId1 = WalletId.random val walletId2 = WalletId.random val wallet1 = ZLayer.succeed(WalletAccessContext(walletId1)) @@ -442,7 +442,6 @@ object PresentationRepositorySpecSuite { record2.id, Some(FailureInfo("PresentationRepositorySpecSuite", StatusCode(999), "fail reason")) ) - .provide(wallet2) .exit } yield assert(exit)(dies(hasMessage(equalTo("Unexpected affected row count: 0")))) }, diff --git a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala index 36a68da0bb..60cbe80cbe 100644 --- a/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala +++ b/pollux/core/src/test/scala/org/hyperledger/identus/pollux/core/service/MockPresentationService.scala @@ -18,6 +18,7 @@ import org.hyperledger.identus.shared.models.* import zio.{mock, IO, URLayer, ZIO, ZLayer} import zio.json.* import zio.mock.{Mock, Proxy} +import zio.UIO import java.time.Instant import java.util.UUID @@ -262,7 +263,7 @@ object MockPresentationService extends Mock[PresentationService] { override def reportProcessingFailure( recordId: DidCommID, failReason: Option[Failure] - ): IO[PresentationError, Unit] = ??? + ): UIO[Unit] = ??? } }