Skip to content

Add ContinueAsNew(ContinueAsNewOptions) override to FunctionsOrchestrationContext#3404

Merged
YunchuWang merged 4 commits intodevfrom
wangbill/continue-as-new-version-override
Mar 27, 2026
Merged

Add ContinueAsNew(ContinueAsNewOptions) override to FunctionsOrchestrationContext#3404
YunchuWang merged 4 commits intodevfrom
wangbill/continue-as-new-version-override

Conversation

@YunchuWang
Copy link
Copy Markdown
Member

@YunchuWang YunchuWang commented Mar 21, 2026

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.

Part 2 of 3 in the ContinueAsNew version migration feature.

Problem

TaskOrchestrationContext gained a new virtual overload in microsoft/durabletask-dotnet#682:

public virtual void ContinueAsNew(ContinueAsNewOptions options)

FunctionsOrchestrationContext wraps an inner TaskOrchestrationContext and overrides all methods to delegate. However, it only overrides the 2-param ContinueAsNew(object?, bool), so the new single-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:

public override void ContinueAsNew(ContinueAsNewOptions options)
{
    this.EnsureLegalAccess();
    this.innerContext.ContinueAsNew(options);
}

Changes in this PR

  1. FunctionsOrchestrationContext.cs — Added ContinueAsNew(ContinueAsNewOptions) override
  2. Directory.Packages.props — Bumped Microsoft.DurableTask.Client.Grpc, Worker.Grpc, and Abstractions from 1.23.01.23.1 (the version containing ContinueAsNewOptions from Adding query feature for the conditional query #682)

Release Order

# Repo PR Status
1 durabletask-dotnet #682 MergedContinueAsNewOptions defined, NuGet v1.23.1 published
2 azure-functions-durable-extension This PR (#3404) 🟢 Ready for review — rebased onto dev, package bumped to v1.23.1
3 AAPT-DTMB ADO PR #15133055 🟢 Ready for review — code fix complete, test re-added with package bump

E2E Testing Results

Tested locally with Azure Functions isolated worker + Azurite + all 3 PRs applied:

  • Build: 0 errors across all 3 repos
  • Gen 1: ContinueAsNew with NewVersion='v2' — correctly sends NewVersion through SDK → proto → Core dispatcher → Azure Storage
  • Gen 2: ExecutionStartedEvent correctly has version=v2
  • Note: Azure Functions Durable extension's default versionMatchStrategy: CurrentOrOlder rejects gen 2 because v2 > null (worker has no declared version). Users need "versionMatchStrategy": "None" in host.json for version migration. This is a pre-existing config constraint.

Dependencies

@YunchuWang YunchuWang force-pushed the wangbill/continue-as-new-version-override branch from 6ff35bf to 3f09bf2 Compare March 23, 2026 23:11
@YunchuWang YunchuWang changed the base branch from main to dev March 27, 2026 02:26
YunchuWang and others added 4 commits March 26, 2026 19:27
…ationContext

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.
Align with durabletask-dotnet PR #682: ContinueAsNew now takes a single
ContinueAsNewOptions parameter with NewInput, PreserveUnprocessedEvents,
and NewVersion folded into the options object.
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>
@YunchuWang YunchuWang force-pushed the wangbill/continue-as-new-version-override branch from 612c16b to 532833d Compare March 27, 2026 02:28
Copilot AI review requested due to automatic review settings March 27, 2026 02:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the isolated worker orchestration wrapper to correctly forward the new ContinueAsNew(ContinueAsNewOptions) overload (including NewVersion) to the underlying TaskOrchestrationContext, and bumps the DurableTask package versions to pick up the required API.

Changes:

  • Added FunctionsOrchestrationContext.ContinueAsNew(ContinueAsNewOptions) override that delegates to the inner context.
  • Updated central package versions for Microsoft.DurableTask.* to 1.23.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Worker.Extensions.DurableTask/FunctionsOrchestrationContext.cs Adds the missing ContinueAsNew(ContinueAsNewOptions) delegation override so options aren’t dropped.
Directory.Packages.props Bumps DurableTask package versions to the patch containing the new overload/options type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@YunchuWang YunchuWang merged commit 4cd29f4 into dev Mar 27, 2026
62 checks passed
@andystaples andystaples deleted the wangbill/continue-as-new-version-override branch March 27, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants