Is your feature request related to a problem? Please describe.
Handler methods are matched to the service definition by exact method name, so a [TemporalOperation] method has to be named Greet, not GreetAsync. But it returns Task<TemporalOperationResult<T>>, so VSTHRD200 wants the suffix, and adding it fails at AddNexusService:
ArgumentException: Missing handlers for defined operations: 'Greet'
Renaming the interface method to match doesn't help: definition methods can't return Task, so VSTHRD200 then complains in the other direction about a non-awaitable method ending in Async.
The result is that every [TemporalOperation] method needs a #pragma warning disable VSTHRD200 (see samples-dotnet#214). This is specific to [TemporalOperation]. [NexusOperationHandler] factory style returns IOperationHandler<,>, so the analyzer never fires there.
Describe the solution you'd like
Trim a trailing Async when matching a handler method to an operation, the way [Activity], [WorkflowSignal], and [WorkflowUpdate] already do when deriving their default names. The wire operation name would keep coming from the definition, so nothing cross-language changes.
Additional context
Temporalio 1.18.0, NexusRpc 0.4.0.
The matching happens in NexusRpc's ServiceHandlerInstance.FromInstance (o.MethodInfo?.Name == method.Name), so the change may belong in nexus-rpc/sdk-dotnet instead. Filing here because [TemporalOperation] is where it's actually hit.
Is your feature request related to a problem? Please describe.
Handler methods are matched to the service definition by exact method name, so a
[TemporalOperation]method has to be namedGreet, notGreetAsync. But it returnsTask<TemporalOperationResult<T>>, so VSTHRD200 wants the suffix, and adding it fails atAddNexusService:Renaming the interface method to match doesn't help: definition methods can't return
Task, so VSTHRD200 then complains in the other direction about a non-awaitable method ending inAsync.The result is that every
[TemporalOperation]method needs a#pragma warning disable VSTHRD200(see samples-dotnet#214). This is specific to[TemporalOperation].[NexusOperationHandler]factory style returnsIOperationHandler<,>, so the analyzer never fires there.Describe the solution you'd like
Trim a trailing
Asyncwhen matching a handler method to an operation, the way[Activity],[WorkflowSignal], and[WorkflowUpdate]already do when deriving their default names. The wire operation name would keep coming from the definition, so nothing cross-language changes.Additional context
Temporalio 1.18.0, NexusRpc 0.4.0.
The matching happens in NexusRpc's
ServiceHandlerInstance.FromInstance(o.MethodInfo?.Name == method.Name), so the change may belong in nexus-rpc/sdk-dotnet instead. Filing here because[TemporalOperation]is where it's actually hit.