-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): Allow recovering from errors that happen during the preparation part of an aspirate command #16896
base: edge
Are you sure you want to change the base?
Conversation
if isinstance(move_result, DefinedErrorData): | ||
return DefinedErrorData(move_result.public, state_update=state_update) | ||
|
||
# TODO: Figure out what to do for state_update_if_false_positive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo passthrough and union with previous successes
def append(self, other: Self) -> Self: | ||
"""Apply another `StateUpdate` "on top of" this one. | ||
|
||
This object is mutated in-place, taking values from `other`. | ||
If an attribute in `other` is `NO_CHANGE`, the value in this object is kept. | ||
""" | ||
fields = dataclasses.fields(other) | ||
for field in fields: | ||
other_value = other.__dict__[field.name] | ||
if other_value != NO_CHANGE: | ||
self.__dict__[field.name] = other_value | ||
return self | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is append()
a good name for this? Is there a naming scheme that harmonizes better with reduce()
?
@classmethod | ||
def reduce(cls: typing.Type[Self], *args: Self) -> Self: | ||
"""Fuse multiple state updates into a single one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Can probably implement reduce()
in terms of append()
.
Overview
Closes RQA-3567.
Test Plan and Hands on Testing
commandType: "home"
intent: "fixit"
command.Changelog
There are 4 substeps in an
aspirate
command:blowOut
and prepare for theaspirate
.Prior work already lets us recover from overpressure and stall errors in steps 3 and 4. This does the same for steps 1 and 2.
Review requests
Risk assessment