fix: read protobuf StringValue activity input with getValue#280
Merged
YunchuWang merged 1 commit intoJul 23, 2026
Merged
Conversation
…activity execution Replace incorrect .toString() call on protobuf StringValue with the correct .getValue() API in _executeActivityInternal. The toString() method on protobuf Message objects calls the base class implementation which relies on internal array representation, not the documented field accessor. Also remove redundant .toString() on the activity result (already a string). Add tests verifying activity input extraction and result serialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes activity input extraction in the gRPC worker by using the documented protobuf StringValue.getValue() accessor instead of relying on toString()’s incidental behavior, aligning the worker with stable protobuf APIs and the rest of the SDK’s wrapper usage. It also updates the activity result handling to avoid redundant string coercion and adds tests around input/output behavior.
Changes:
- Read
ActivityRequest.inputviareq.getInput()?.getValue()instead oftoString(). - Remove redundant
.toString()when setting the activity resultStringValue. - Add worker-level tests for activity input deserialization and result serialization.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/durabletask-js/src/worker/task-hub-grpc-worker.ts | Uses StringValue.getValue() for activity input and avoids redundant output string coercion. |
| packages/durabletask-js/test/worker-activity-response.spec.ts | Adds tests for activity input extraction and ActivityResponse result encoding/empty-result behavior. |
kaibocai
approved these changes
Jul 23, 2026
YunchuWang
deleted the
copilot-finds/bug/fix-protobuf-tostring-activity-input
branch
July 23, 2026 20:08
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.
Summary
Fixes #223