Skip to content

Commit b0b77ba

Browse files
torosentCopilot
andcommitted
Fix two Copilot review nits
1) ActivityUnversionedFallback XML doc previously claimed MatchStrategy does not gate activity dispatch. That's incorrect: GrpcDurableTaskWorker's OnRunActivityAsync calls EvaluateOrchestrationVersioning against the activity work item's version (set via TaskOptions.Version at schedule time, or inherited from the calling orchestration when null), and the strict-mode work-item filter narrows activity filters too. Rewrote the interaction bullet to match actual behavior. 2) UnversionedFallbackSample/Program.cs had a comment saying orchestrator fallback was 'commented below' while the next line actively enabled it. Rewrote the comment to match what the sample actually does: both flags are enabled to demonstrate orchestrator catch-all dispatch; the advice to start with activity-only stays as guidance for the reader's own code. Addresses Copilot review feedback at #discussion_r3305294155 and #discussion_r3305294212. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e01fa18 commit b0b77ba

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

samples/UnversionedFallbackSample/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
wb.AddTasks(tasks => tasks.AddAllGeneratedTasks());
2828
wb.UseVersioning(new DurableTaskWorkerOptions.VersioningOptions
2929
{
30-
// Activity fallback is the safer place to start: activities are stateless and do not replay
31-
// history. Enable orchestrator fallback (commented below) only when the unversioned
32-
// orchestrator is replay-compatible with every version it may receive.
30+
// This sample enables CatchAll fallback on both sides. Activity fallback is the safer place to
31+
// start in your own code (activities are stateless and don't replay history); only enable
32+
// orchestrator fallback when the unversioned orchestrator is replay-compatible with every
33+
// version it may receive.
3334
ActivityUnversionedFallback = DurableTaskWorkerOptions.UnversionedFallbackMode.CatchAll,
3435
OrchestratorUnversionedFallback = DurableTaskWorkerOptions.UnversionedFallbackMode.CatchAll,
3536
});

src/Worker/Core/DurableTaskWorkerOptions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,12 @@ public class VersioningOptions
364364
/// <list type="bullet">
365365
/// <item><description>Unlike <see cref="FailureStrategy"/>, this setting applies regardless of
366366
/// <see cref="MatchStrategy"/>.</description></item>
367-
/// <item><description><see cref="MatchStrategy"/> applies to orchestration instance versions, not
368-
/// activity scheduling versions, so it does not gate activity dispatch.</description></item>
367+
/// <item><description>When <see cref="MatchStrategy"/> is not <see cref="VersionMatchStrategy.None"/>,
368+
/// the pre-dispatch versioning gate also evaluates the activity work item's version (set via
369+
/// <c>TaskOptions.Version</c> at schedule time, or inherited from the calling orchestration's
370+
/// instance version when <c>TaskOptions.Version</c> is <c>null</c>) and rejects mismatches per
371+
/// <see cref="FailureStrategy"/>. This setting governs only how the factory resolves activity
372+
/// work items that pass the gate.</description></item>
369373
/// </list>
370374
/// </remarks>
371375
public UnversionedFallbackMode ActivityUnversionedFallback { get; set; } = UnversionedFallbackMode.Implicit;

0 commit comments

Comments
 (0)