Skip to content

Conversation

@valencik
Copy link

@valencik valencik commented Nov 20, 2025

This PR updates all huckle's dependencies.

Most consequential is updating cats-effect past 3.5.0 which introduced a breaking semantic change in race which huckle relied.
This manifested in flakey test failures noted by the angry ❌ in my commit statuses.
For more context, the PR introducing the change: typelevel/cats-effect#3453
For even more context, we can see a certain someone predicting that this code would break here: typelevel/cats-effect#3396 (comment)

Arman and I chatted about a more user friendly API that allows for "forfeiting", a possible raceOption where the first Some wins and None can be used to forfeit the race.

I have attempted to write this combinator in utils.scala and have used it in resolve.
In my testing, I cannot get the tests to flake anymore.

case Outcome.Succeeded(fa) =>
fa.flatMap {
case Some(a) => f.cancel.as(Some(a))
case None =>
Copy link
Author

Choose a reason for hiding this comment

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

We won the race, but we decided to "forfeit" so we have to look to the loser to decide what to do.

}
case Outcome.Errored(e) => f.cancel *> F.raiseError(e)
case Outcome.Canceled() =>
f.cancel *> f.join.flatMap {
Copy link
Author

Choose a reason for hiding this comment

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

We copy the new semantics of race here because we are no longer using self-cancelation for anything meaningful, instead we use None to signal "forfeiting".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant