[kilted] Fix incorrect action client feedback callback type hint#1654
Closed
laser wants to merge 1 commit into
Closed
[kilted] Fix incorrect action client feedback callback type hint#1654laser wants to merge 1 commit into
laser wants to merge 1 commit into
Conversation
…hint The ActionClient.send_goal_async() feedback_callback parameter is declared as Callable[[FeedbackT], None] but the runtime dispatcher invokes the registered callback with a FeedbackMessage[FeedbackT] (the wrapper carrying goal_id and feedback fields), not a bare FeedbackT. Consumers who type their callback correctly according to the declared signature cannot reach the feedback payload. This is a client-side-only backport of upstream commit f735d59 (PR ros2#1616) to kilted. The server-side changes in that PR depend on the ImplT generic parameter introduced after kilted, so they are excluded here. Introduces a FeedbackCallbackUnion type alias in the TYPE_CHECKING block and threads it through SendGoalKWargs, the internal _feedback_callbacks dict, and send_goal_async's signature. No runtime behavior changes; this is a pure type-hint correction. Signed-off-by: Laser <l@s3r.me>
4a28811 to
1c8ac8f
Compare
Contributor
Author
Contributor
|
@laser I added you as a co-author since you technically helped me by reminding to do this. |
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.
What Problem Are We Trying to Solve?
ActionClient.send_goal_async()declaresfeedback_callbackasCallable[[FeedbackT], None], but the runtime dispatcher in the same file invokes the registered callback with aFeedbackMessage[FeedbackT](the wrapper withgoal_idandfeedbackfields), not a bareFeedbackT.How Did We Solve the Problem?
FeedbackCallbackUnionTypeAliasin theTYPE_CHECKINGblock, moveSendGoalKWargsinto the same block asGeneric[FeedbackT], and use the new alias in_feedback_callbacks,send_goal, andsend_goal_async.test_action_client.pyto typefeedback_callbackwithFeedbackMessage[Fibonacci.Feedback], documenting the corrected signature.ImplTgeneric parameter introduced after kilted.