Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #4002 #4003

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Fix issue #4002 #4003

merged 2 commits into from
Feb 19, 2024

Conversation

durban
Copy link
Contributor

@durban durban commented Feb 17, 2024

This PR makes IO#asyncCheckAttempt work the same as Async#asyncCheckAttempt. So both will be uncancelable when suspended with a None finalizer. Closes #4002.

@durban durban linked an issue Feb 17, 2024 that may be closed by this pull request
@@ -1206,7 +1206,7 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {
lift(k(resume)) flatMap {
case Right(a) => G.pure(a)
case Left(Some(fin)) => G.onCancel(poll(get), lift(fin))
case Left(None) => poll(get)
case Left(None) => get
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause the same kind of semantic break as the async_ change in 3.5.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

As far as I can tell, asyncCheckAttempt should have been added like this in 3.5.0 (and for Async, it was). It's only due to an unlucky git merge that it wasn't. (And I guess due to the lack of a unit test.)

Copy link
Member

@djspiewak djspiewak Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the impact of this is much lower than the async_ change, since this is a far less widely used constructor. Also we override the Async implementation in Async[IO], so this bug fix is actually entirely shadowed unless you're using monad transformers or a third-party effect. I think it's fair to consider this PR to be a bug fix rather than a breaking change.

Edit: Oh my shadowing argument is backwards. Rip. Either way, bug fix IMO.

@djspiewak djspiewak merged commit d16bc0f into typelevel:series/3.5.x Feb 19, 2024
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IO#asyncCheckAttempt is inconsistent with Async#asyncCheckAttempt
3 participants