Skip to content

Releases: chunty/TaskTurnstile

v2.0.2

18 May 15:01

Choose a tag to compare

What's new

SQL Server store: table auto-creation now actually works

The AddSqlServerStore extension promised auto-creation of the cache table on first startup but never delivered - the hosted service responsible was never registered.

This release fixes that using an inline Serilog-style approach: the table is created synchronously the first time ITaskStateStore is resolved, with no hosted service required.

Safe defaults for minimal configuration

You no longer need to specify TableName or SchemaName:

services.AddTaskTurnstile()
        .AddSqlServerStore(o => o.ConnectionString = config.GetConnectionString("Default"));
  • TableName defaults to ActiveTasks
  • SchemaName defaults to dbo
  • ConnectionString is validated at registration time - a clear ArgumentException is thrown immediately rather than failing silently at request time

v2.0.1

14 May 16:16

Choose a tag to compare

Breaking changes from v2.0.0

Namespace split — update your using directives

using TaskTurnstile.Testing is no longer sufficient. Use the framework-specific namespace:

// Moq / AutoMocker
using TaskTurnstile.Testing.Moq;

// NSubstitute
using TaskTurnstile.Testing.NSubstitute;

Bug fixes

  • Fix ArgumentException when using object keys with Moq extensions — Returns<string,...> callbacks were left over from v1.x and failed when a non-string key was passed. Fixed to Returns<object,...>.
  • Fix CS0012 compiler error — resolved by splitting into separate namespaces so consumers only bring the mocking framework they use into scope.

v2.0.0 has critical bugs — please upgrade to v2.0.1.

v2.0.0

14 May 14:49

Choose a tag to compare

Breaking changes

ITaskStateManagerstring taskNameobject taskKey

All methods now accept object taskKey instead of string taskName. String keys continue to work unchanged — no code changes required unless you used named arguments (taskName:taskKey:).

See the migration guide for full details.

⚠️ v2.0.0 has critical bugs in TaskTurnstile.Testing — upgrade to v2.0.1.

What's new

  • Object task keys — pass strings, primitives, enums, Guid, DateTime, or any complex object as a task key
  • TaskKeyConverter.ToKey(object key) — public utility to resolve the store key from any object; useful in tests asserting against ITaskStateStore
  • Keys stored with type prefix for human readability (e.g. System.Int32:42, MyApp.JobKey:a3f9...)

Key conversion rules

Type Stored as
string as-is
Primitives, enums, Guid, DateTime, etc. {TypeFullName}:{value}
Complex objects {TypeFullName}:{sha256-of-json}

v1.1.0

14 May 14:39

Choose a tag to compare

What's New

TaskTurnstile.Testing

  • Added SetupTryRunAsync, SetupTryRunAsyncToSkip, and SetupRunAsync extension methods for Mock (Moq) and ITaskStateManager substitutes (NSubstitute)
  • Reduces verbose mock setup boilerplate to a single line in unit tests

Documentation

  • New wiki Testing page with setup helper examples
  • Updated NuGet README for TaskTurnstile.Testing

v1.0.4

14 May 10:51

Choose a tag to compare

What's new

New package: TaskTurnstile.Testing

A new TaskTurnstile.Testing NuGet package providing FakeTaskStateManager — a framework-agnostic in-memory test double for ITaskStateManager. Eliminates verbose mock setup boilerplate:

// Before (Moq + AutoMocker)
Mocker.GetMock<ITaskStateManager>()
    .Setup(m => m.TryRunAsync(
        It.IsAny<string>(),
        It.IsAny<Func<CancellationToken, Task>>(),
        It.IsAny<TimeSpan?>(),
        It.IsAny<CancellationToken>()))
    .Returns<string, Func<CancellationToken, Task>, TimeSpan?, CancellationToken>(
        async (_, work, _, ct) => { await work(ct); return true; });

// After
Mocker.Use<ITaskStateManager>(new FakeTaskStateManager());
  • MarkRunning(taskName) helper to pre-seed running state in test arrange steps
  • WaitTimeout property (default 5 s) prevents infinite hangs in misconfigured tests
  • Works with any test framework (xUnit, NUnit, MSTest) and any mock library

Documentation

  • Full GitHub Wiki added: Setup, API Reference, Patterns, Testing, Custom Store pages
  • README updated: distributed store capability now front and centre with Redis / SQL Server / IDistributedCache quick-start snippets

v1.0.3

02 May 18:16

Choose a tag to compare

Fixes

  • Fixed release pipeline publishing wrong version — MinVer was ignoring GitHub's lightweight tags, causing packages
    to publish as pre-release (e.g. 0.0.0-alpha.0.15)

Improvements

  • NuGet package pages now include a README with usage documentation
  • Fixed NuGet badges in the GitHub README (were pointing at wrong repository)
  • Fixed PackageProjectUrl to point to the correct repository

Internal

  • Central package management via Directory.Packages.props
  • Multi-targeting: all library packages now target both net9.0 and net10.0
  • Restructured project layout — main project files now at repository root, consistent with library conventions
  • Simplified .gitignore using **/bin/ and **/obj/ patterns
  • Added workflow_dispatch to release workflow for manual re-runs
  • Added Solution Items folder in .slnx for visibility of README.md in Solution Explorer

1.0.0

01 May 22:34
95e81b9

Choose a tag to compare

First release