Repository navigation
fix(grpc): send the transport's default tenant when creating a push notification config - #1319
Merged
kabir merged 1 commit intoNov 24, 2026
Conversation
…otification config GrpcTransport resolves a default tenant once, in its constructor, and applies it to every request it builds: sendMessage, getTask, cancelTask, listTasks, subscribeToTask, getExtendedAgentCard, get/delete/list push notification configs all go through resolveTenant(request.tenant()). createTaskPushNotificationConfiguration was the one exception. It mapped the domain config straight to proto, so the tenant was only set when the caller had passed one explicitly. GrpcTransportProvider always seeds the transport with agentInterface.tenant(), which means a client built from a tenant-scoped interface sent that tenant with every call except this one. The proto carries tenant as field 1, so the request arrived with an empty tenant and the config was created against the server's default tenant instead of the requested one - a multi-tenant server either rejects it as task-not-found or stores it where notifications for that task never fire. Route the payload through resolveTenant as well, so all ten operations agree on which tenant the request belongs to.
Contributor
Author
|
Small nudge, no urgency intended. This one is the single gRPC operation that does not apply the transport's configured default tenant when creating a push notification config, so the config lands under the empty tenant. 2 files / 43 lines, 14/14 checks green since Nov 11. Glad to adjust the shape or add a test case you have in mind. |
Collaborator
|
Thanks @WMK666666 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GrpcTransporttakes a default tenant in its constructor (GrpcTransportProvideralways passesagentInterface.tenant()) and applies it to every request it builds throughresolveTenant(request.tenant()):sendMessage(viacreateRequestWithTenant)getTaskcancelTasklistTaskssubscribeToTaskgetExtendedAgentCardgetTaskPushNotificationConfigurationlistTaskPushNotificationConfigurationsdeleteTaskPushNotificationConfigurationscreateTaskPushNotificationConfigurationcreateTaskPushNotificationConfigurationmapped the domain config straight to proto, so the tenant field was populated only when the caller happened to set it on theTaskPushNotificationConfigitself.TaskPushNotificationConfigin the proto carriestenantas field 1 and is used as the request message ofCreateTaskPushNotificationConfig, so the request went out with an empty tenant.What that looks like
A client built from a tenant-scoped interface:
sends
tenant = ""with this call while every other call on the same transport carriestenant-a. Against a multi-tenant server the config is either rejected (TaskNotFoundError, because the task lives intenant-a) or stored under the default tenant, where the push notification for that task never fires — the caller has no way to tell which happened.Fix
The one-line version of what the other nine operations already do:
resolveTenantkeeps an explicitly requested tenant, so nothing changes for callers that set one.Tests
Two cases added to
GrpcTransportTest, using the existing in-process server (acreateTaskPushNotificationConfighandler now records the received message):testCreatePushNotificationConfigUsesDefaultTenant— transport built withdefault-tenant, config without a tenant.testCreatePushNotificationConfigPrefersRequestTenant—request-tenanton the config wins over the transport default.On
mainthe first one fails withexpected: <default-tenant> but was: <>; with the fix the module is green (18 tests,client/transport/grpc).