From cbe8bc5dd30fdc26e34adbe396cf3ae14af40fa4 Mon Sep 17 00:00:00 2001 From: Kyri Petrou Date: Thu, 25 Jul 2024 09:05:42 +0300 Subject: [PATCH] Make sure to complete the interruption CB --- .../shared/src/main/scala/zio/interop/package.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala b/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala index 382eb3f3..bd083a0f 100644 --- a/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala +++ b/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala @@ -54,7 +54,10 @@ package object interop { fiber.unsafe.removeObserver(completeCb) fiber.tellInterrupt(Cause.interrupt(fiber.id)) // Allow the interruption to be interrupted - Some(F.delay(fiber.unsafe.removeObserver(interruptCb))) + Some(F.delay { + fiber.unsafe.removeObserver(interruptCb) + interruptCb(null) + }) } })) case Right(v) => Right(v) // No need to invoke the callback, sync resumption will take place