Releases: chunty/TaskTurnstile
v2.0.2
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"));TableNamedefaults toActiveTasksSchemaNamedefaults todboConnectionStringis validated at registration time - a clearArgumentExceptionis thrown immediately rather than failing silently at request time
v2.0.1
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
Breaking changes
ITaskStateManager — string taskName → object 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 inTaskTurnstile.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 againstITaskStateStore- 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
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
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 stepsWaitTimeoutproperty (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 /
IDistributedCachequick-start snippets
v1.0.3
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