Open
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts error-handling conditions for registration and generic reply handling in the web service so that only explicit, non-zero, non-"UNSPECIFIED" error codes are treated as failures, and fixes the Python client dataGet logic to check for presence of a task field using protobuf’s HasField before waiting on task progress. Flow diagram for updated dataGet task wait logic in CommandLibflowchart TD
Start[Call_dataGet]
BuildRequest[Build dataGet
request message]
SendRecv[Send request via mapi
and receive reply list]
CheckTask{reply_index_0
HasField task
AND wait is True}
BuildTaskView[Build sdms
TaskViewRequest
with task_id
from reply_index_0.task.id]
WaitLoop[Poll task status
until completion
or timeout]
ReturnResult[Return final
result to caller]
Start --> BuildRequest --> SendRecv --> CheckTask
CheckTask -- Yes --> BuildTaskView --> WaitLoop --> ReturnResult
CheckTask -- No --> ReturnResult
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The error-code checks for registration and generic replies now use the same multi-clause condition; consider extracting this into a shared helper (e.g.,
isErrorCode(errCode)) to avoid duplication and keep the semantics consistent if they change later. - The
errCodecomparisons mix numeric (0) and string ("UNSPECIFIED") values; it might be more robust to normalizeerrCodeto a single type or use a small mapping/enum to avoid subtle bugs if the backend changes its representation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The error-code checks for registration and generic replies now use the same multi-clause condition; consider extracting this into a shared helper (e.g., `isErrorCode(errCode)`) to avoid duplication and keep the semantics consistent if they change later.
- The `errCode` comparisons mix numeric (`0`) and string (`"UNSPECIFIED"`) values; it might be more robust to normalize `errCode` to a single type or use a small mapping/enum to avoid subtle bugs if the backend changes its representation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Description
How Has This Been Tested?
Artifacts (if appropriate):
Tasks
Summary by Sourcery
Handle registration and generic replies more robustly by treating only non-zero, non-UNSPECIFIED error codes as errors and fix task presence detection in data download command.
Bug Fixes: