arrow-kt / arrow-kt/arrow

`saga`'s `totalCompensation` eagerly throws `CancellationException`

Open Beginner friendly
#3,926 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
6.6k
Forks
472
Avg merge
3d 49m
Merged PRs (30d)
4

Description

`mergeSuppressed` already handles fatal exceptions in `other` properly, so the following line is useless:
```kotlin
acc mergeSuppressed e.nonFatalOrThrow()
```
Even worse, it throws `CancellationException` too eagerly. This doesn't match the behavior of `resourceScope`, for one.
changing it to `acc mergeSuppressed e` would fix the issue!

Contributor guide

Open the contributing guide

Research direction

Locate saga's totalCompensation and inspect the mergeSuppressed call that applies nonFatalOrThrow to the exception. Compare its cancellation behavior with resourceScope, then verify that merging exceptions no longer eagerly throws CancellationException.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.