Skip to content

Task.sequential/sequentialDo: align net11.0 when FSharp.Core ships dotnet/fsharp#20695 #384

Open

Description

@TheAngryByrd

Automated: written by Claude Code for the maintainer.

Problem

PR #373 ships Task.sequential and Task.sequentialDo in two ways:

The same call gives different results on net10 and net11 when the token is already canceled:

Call with CancellationToken(true) net10.0 (FsToolkit shim) net11.0 (FSharp.Core 11.0.101)
Task.sequential ct [fun _ -> Task.FromResult 1] Canceled, factory not called RanToCompletion with [|1|], factory called once
Task.sequentialDo ct [fun _ -> Task.FromResult ()] Canceled RanToCompletion

FsToolkit cannot change the net11.0 behavior, because net11.0 consumers do not call the shim.

Decision

Keep the shim on the main behavior. Wait for an FSharp.Core release that contains dotnet/fsharp#20695.

When that FSharp.Core release ships

  1. Raise the net11.0 FSharp.Core version in src/Directory.Build.props and tests/Directory.Build.props to that release.
  2. In tests/FsToolkit.ErrorHandling.Tests/FSharpCore11ShimBehavior.fs, make the canceled-token tests for sequential and sequentialDo run on net11.0 too. They are pending on net11.0 now.
  3. Remove the NOTE above sequential in src/FsToolkit.ErrorHandling/Task.FSharpCore11.fs.
  4. Add a line to RELEASE_NOTES.md with the new FSharp.Core minimum for net11.0.

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions