From 54a5df6bcba99c2e8bb72f35f4bfa0fbe432d1da Mon Sep 17 00:00:00 2001 From: wangbill Date: Sat, 21 Mar 2026 12:37:21 -0700 Subject: [PATCH 1/4] Add ContinueAsNew(ContinueAsNewOptions) override to FunctionsOrchestrationContext Forward the new ContinueAsNew overload that accepts ContinueAsNewOptions (with NewVersion) to the inner context. Without this override, the base class default silently drops the options, preventing version migration via ContinueAsNew from working in Azure Functions isolated worker. Depends on: microsoft/durabletask-dotnet#682 (adds ContinueAsNewOptions) Requires bumping Microsoft.DurableTask.Worker.Grpc to the version that includes ContinueAsNewOptions. --- .../FunctionsOrchestrationContext.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs b/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs index 004e13aa5..a48edb59d 100644 --- a/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs +++ b/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs @@ -127,6 +127,12 @@ public override void ContinueAsNew(object? newInput = null, bool preserveUnproce this.innerContext.ContinueAsNew(newInput, preserveUnprocessedEvents); } + public override void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) + { + this.EnsureLegalAccess(); + this.innerContext.ContinueAsNew(options, newInput, preserveUnprocessedEvents); + } + public override Task CreateTimer(DateTime fireAt, CancellationToken cancellationToken) { this.EnsureLegalAccess(); From 2e5a2625565f1a9500659be37dfb319c1c34e3d7 Mon Sep 17 00:00:00 2001 From: wangbill Date: Mon, 23 Mar 2026 14:08:02 -0700 Subject: [PATCH 2/4] Add missing ContinueAsNew override to FunctionsOrchestrationContext for NewVersion support --- pr-body.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pr-body.md diff --git a/pr-body.md b/pr-body.md new file mode 100644 index 000000000..f53f3158a --- /dev/null +++ b/pr-body.md @@ -0,0 +1,35 @@ +## Summary + +Adds a missing `ContinueAsNew` override to `FunctionsOrchestrationContext` so that the new `ContinueAsNewOptions` (with `NewVersion`) is forwarded to the inner context instead of being silently dropped by the base class default. + +## Problem + +`TaskOrchestrationContext` gained a new virtual overload in microsoft/durabletask-dotnet#682: + +```csharp +public virtual void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) +``` + +`FunctionsOrchestrationContext` wraps an inner `TaskOrchestrationContext` and overrides all methods to delegate. However, it only overrides the 2-param `ContinueAsNew(object?, bool)`, so the new 3-param overload falls through to the base class default which ignores `ContinueAsNewOptions` entirely. This means `NewVersion` is silently lost when called from Azure Functions isolated worker. + +## Fix + +One-line override that delegates to the inner context: + +```csharp +public override void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) +{ + this.EnsureLegalAccess(); + this.innerContext.ContinueAsNew(options, newInput, preserveUnprocessedEvents); +} +``` + +## Dependencies + +- **Requires**: microsoft/durabletask-dotnet#682 to be merged and a new `Microsoft.DurableTask.Worker.Grpc` NuGet package to be published (introduces `ContinueAsNewOptions`). +- The package reference version in the csproj will need to be bumped to the version containing `ContinueAsNewOptions`. + +## Testing + +- Build will not succeed until the NuGet dependency is updated. +- E2E validated locally by running the AzureFunctionsApp sample with Azurite — confirmed that without this override, `context.Version` returns empty string after ContinueAsNew with `NewVersion = "v2"`, and with this override it correctly returns `"v2"`. From f4eac0950c0d158746d01d3eef9a8988d623af8c Mon Sep 17 00:00:00 2001 From: wangbill Date: Mon, 23 Mar 2026 16:01:49 -0700 Subject: [PATCH 3/4] Update ContinueAsNew override to match new single-parameter signature Align with durabletask-dotnet PR #682: ContinueAsNew now takes a single ContinueAsNewOptions parameter with NewInput, PreserveUnprocessedEvents, and NewVersion folded into the options object. --- pr-body.md | 35 ------------------- .../FunctionsOrchestrationContext.cs | 4 +-- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 pr-body.md diff --git a/pr-body.md b/pr-body.md deleted file mode 100644 index f53f3158a..000000000 --- a/pr-body.md +++ /dev/null @@ -1,35 +0,0 @@ -## Summary - -Adds a missing `ContinueAsNew` override to `FunctionsOrchestrationContext` so that the new `ContinueAsNewOptions` (with `NewVersion`) is forwarded to the inner context instead of being silently dropped by the base class default. - -## Problem - -`TaskOrchestrationContext` gained a new virtual overload in microsoft/durabletask-dotnet#682: - -```csharp -public virtual void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) -``` - -`FunctionsOrchestrationContext` wraps an inner `TaskOrchestrationContext` and overrides all methods to delegate. However, it only overrides the 2-param `ContinueAsNew(object?, bool)`, so the new 3-param overload falls through to the base class default which ignores `ContinueAsNewOptions` entirely. This means `NewVersion` is silently lost when called from Azure Functions isolated worker. - -## Fix - -One-line override that delegates to the inner context: - -```csharp -public override void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) -{ - this.EnsureLegalAccess(); - this.innerContext.ContinueAsNew(options, newInput, preserveUnprocessedEvents); -} -``` - -## Dependencies - -- **Requires**: microsoft/durabletask-dotnet#682 to be merged and a new `Microsoft.DurableTask.Worker.Grpc` NuGet package to be published (introduces `ContinueAsNewOptions`). -- The package reference version in the csproj will need to be bumped to the version containing `ContinueAsNewOptions`. - -## Testing - -- Build will not succeed until the NuGet dependency is updated. -- E2E validated locally by running the AzureFunctionsApp sample with Azurite — confirmed that without this override, `context.Version` returns empty string after ContinueAsNew with `NewVersion = "v2"`, and with this override it correctly returns `"v2"`. diff --git a/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs b/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs index a48edb59d..4080409f8 100644 --- a/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs +++ b/src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs @@ -127,10 +127,10 @@ public override void ContinueAsNew(object? newInput = null, bool preserveUnproce this.innerContext.ContinueAsNew(newInput, preserveUnprocessedEvents); } - public override void ContinueAsNew(ContinueAsNewOptions? options, object? newInput, bool preserveUnprocessedEvents) + public override void ContinueAsNew(ContinueAsNewOptions options) { this.EnsureLegalAccess(); - this.innerContext.ContinueAsNew(options, newInput, preserveUnprocessedEvents); + this.innerContext.ContinueAsNew(options); } public override Task CreateTimer(DateTime fireAt, CancellationToken cancellationToken) From 532833d481945217575c016df3aea7f1ef2893e6 Mon Sep 17 00:00:00 2001 From: wangbill Date: Thu, 26 Mar 2026 19:28:47 -0700 Subject: [PATCH 4/4] Bump DurableTask packages to 1.23.1 (contains ContinueAsNewOptions) Update Microsoft.DurableTask.Client.Grpc, Worker.Grpc, and Abstractions from 1.23.0 to 1.23.1 in Directory.Packages.props (CPM). Version 1.23.1 includes ContinueAsNewOptions from microsoft/durabletask-dotnet#682. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index abb15a371..2c18b90cb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -31,9 +31,9 @@ - - - + + +