Skip to content

Conversation

@wayneparrott
Copy link
Collaborator

While the ActionServer implementation will pass it's CancelCallback function a ServerGoalHandler argument, this fact is not clearly documented, not illustrated in the actionserver tests and the TS CancelCallback function declaration does not include a ServerGoalHandle parameter.

This PR updates docs, test suite and modifies the TypeScript CancelCallback function declaration to include a required ServerGoalHandle parameter. The change breaks existing TypeScript ActionServers that implement a custom CancelCallback function with a compilation error.

Question: To make this a non-breaking change we can make the ServerGoalHandle optional. Thoughts?

Fix #866

Copy link
Member

@minggangw minggangw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the doc & examples, LGTM!

* @param cancelCallback - Callback function, if not provided, then unregisters any previously registered callback.
*/
registerCancelCallback(cancelCallback?: CancelCallback): void;
registerCancelCallback(cancelCallback?: CancelCallback<T>): void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional param makes sense, thanks!

@wayneparrott wayneparrott merged commit 02fd217 into RobotWebTools:develop Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActionServer cancelRequestHandler() missing goalHandler param

2 participants