Repository navigation
Fix Durable client current-app detection - #3527
wangbill (YunchuWang) wants to merge 1 commit into
Conversation
Compare durable client targets with the host default provider and let providers define TaskHub identity casing. Cover cross-connection routing and shared HTTP, gRPC, orchestrator, restart, and entity validation behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes DurableClient.ClientReferencesCurrentApp so that “current app” detection is based on the host’s default durability provider (connection + provider-specific TaskHub identity semantics) rather than accidentally self-comparing the target provider. This corrects when local missing/disabled-function validation should be applied vs skipped for truly remote backends, and introduces provider-specific TaskHub casing semantics (Azure Storage case-insensitive, others default to exact/ordinal).
Changes:
- Fix current-app detection to compare against
DurableTaskExtension.DefaultDurabilityProvider(and guard againstconfig == null). - Add
DurabilityProvider.TaskHubNameMatches(...)(ordinal by default) and override it for Azure Storage (ordinal-ignore-case). - Update/add unit tests across direct client, HTTP, and gRPC paths for cross-connection targeting and TaskHub case-variant scenarios.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/FunctionsV2/Tests/Unit/LocalGrpcListenerTests.cs | Adds gRPC coverage for cross-connection disabled-orchestrator starts and exact-case provider TaskHub casing behavior. |
| test/FunctionsV2/Tests/Unit/HttpApiHandlerTests.cs | Updates HTTP disabled-orchestrator tests for cross-connection behavior and adds Azure Storage TaskHub case-variant rejection coverage. |
| test/FunctionsV2/Tests/Unit/DurableClientBaseTests.cs | Adjusts direct-client tests to validate corrected current/remote classification across connections and provider-specific TaskHub casing semantics. |
| src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs | Introduces TaskHubNameMatches extensibility point for provider-specific TaskHub identity matching. |
| src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableClient.cs | Fixes current-app detection to use host default provider for connection + hub matching (and ensures config is present). |
| src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs | Overrides TaskHubNameMatches to be case-insensitive for Azure Storage semantics. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Superseded by #3528. The replacement PR uses a branch in Azure/azure-functions-durable-extension so secret-dependent CI workflows can run. |
Summary
Fixes #3523.
This compatibility correction builds on merged PR #3514 (
477a92915cbeb46423fe55ceb36c036b845b00b0). It keeps the single sharedDurableClient.ClientReferencesCurrentAppgate introduced there, but compares a target client with the host's actual default durability provider instead of comparing the target provider with itself.Before / after
ExternalClient = trueDesign rationale
ClientReferencesCurrentAppremains the only predicate used by missing-orchestrator, missing-entity, and startup-disabled-orchestrator validation.DurableTaskExtension.DefaultDurabilityProvider, passing the target provider. This preserves provider-specific connection matching direction.Compatibility
The intentional behavior change is limited to local metadata validation at corrected current/remote boundaries. Cross-connection operations now reach their configured backend; Azure Storage case variants now receive current-app validation. Exact-case providers, the explicit external-client bypass, replay, and deregistered listener drain behavior remain unchanged.
Tests
TDD RED evidence on
net8.0before production changes:DurableClientBaseTests: 8 expected failures covering cross-connection missing/disabled orchestrator start, restart, entity signal, and Azure Storage case-only matching.Accepted, observedBadRequest.InvalidArgumentlocal rejection.GREEN results:
DurableClientBaseTests: 50/50 passed onnet8.0; 50/50 passed onnet10.0.DurableClientBaseTests,DisabledFunctionDispatchTests,HttpApiHandlerTests,LocalGrpcListenerTests): 187/187 passed onnet8.0; 187/187 passed onnet10.0.git -c core.whitespace=cr-at-eol diff --check: passed.A principal-level review found no critical or important findings.