Update file_name assignment to handle non-string arguments on command report #88
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.
Description
Uses
command_nameasmsg.file_nameon the commands result function whenargs[0]is not of a type compatible with the protobuf message.Previously, assigning
msg.file_name = args[0]would crash upon navigation goal commands being reported as failed by calling theresult_functiondue to_handle_pose_msg_helperparsing the navigation goal message with the pose as the first item of theargsarray, contrary to custom command messages which usefile_name.edge-sdk-python/inorbit_edge/robot.py
Lines 687 to 702 in 794e8ab
NOTE: Calling
result_functionfor a navigation goal message has no effect on the InOrbit side, and reporting a failure through it won't make the user notice it in the UI (the command will appear successful anyway). However, navigation goal commands are dispatched in the same way as custom commands and therefore it is common for connectors to reuse exception handling logic that reports a failures throughresult_function.Note
Ensure
CustomScriptStatusMessage.file_nameusesargs[0]when string/bytes, otherwise falls back tocommand_name, and wirecommand_namethrough result reporting with tests.dispatch_command()to passcommand_nameintoresult_function→report_command_result(...).report_command_resultsignature to acceptcommand_nameand setCustomScriptStatusMessage.file_nametoargs[0]if it isstr/bytes, else usecommand_name.test_report_command_result_file_namevalidatingfile_nameselection and status fields.CUSTOM_COMMAND_STATUS_FINISHEDandMQTT_SCRIPT_OUTPUT_TOPICfor assertions.Written by Cursor Bugbot for commit 073b580. This will update automatically on new commits. Configure here.