-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(discovery-client,app,app-shell): robust robot model detection (
#11301) * feat(discovery-client): robust robot models * refactor(discovery-client): coalesce robot model data from health and mdns As of #11295 , robots advertise their robot model in - a TXT record attached to their MDNS advertisements - the health response presented by the update server in addition to the presentation in the health response from the robot server. The discovery client now harvests (and presents proper types for) all this data and sends it upstream to whatever is listening, with a new advertisedModel field for the MDNS response, and a proper shape for the health data from the update server. * refactor(app,app-shell): robot robot models from discovery We previously could figure out whether a robot was an OT-2 or OT-3 based on an element of the robot server health response, sent to us by the discovery client. However, this isn't robust enough for all the different places we display information about robots - somtimes we can't get the health response but still want to display information. After the previous commit, we now also have robot model information in the server health response, if present; and in a per-address data blob that comes from the MDNS advertisements. We need to coalesce these three data sources into a single robust presentation of the robot model, which we can put in the redux store and add a selector for. We coalesce the data by taking the first valid element from the prioritized list (/health, /server/update/health, mdns) where validity means that the response is present; the key containing the model is present; and the model is regex-valid to known models. If any element is missing or not present, it is skipped. If no element is valid or present, then for now we default to saying that the robot is an OT-2. In the future, that might be a decision we want to make at a higher level. refactor(app): display robot name in device pane Based on the new robust robot model detection, properly display either "OT-2" or "OT-3" in the header bar of a device card and window. Co-authored-by: Koji <[email protected]> Co-authored-by: Mike Cousins <[email protected]>
- Loading branch information
1 parent
9d89b73
commit 8e6d032
Showing
27 changed files
with
776 additions
and
168 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.