Skip to content
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

fix(react-api-client): filter out unknown modules in the /modules endpoint. #15256

Merged
merged 1 commit into from
May 23, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented May 23, 2024

Overview

The desktop app is blocked when it gets an unknown module in the GET /modules response, which happens when the user clicks on the Devices side panel in the desktop app. Since we query modules for all discovered robots, it can be confusing to know which robot the unknown module is connected to. There will sometimes be a lag between developing and supporting new modules in the desktop app. So instead of blocking the desktop app, we should filter out unknown modules in the GET /response.

Closes: RABR-316

Test Plan

  • Connect an unknown module (plate reader) to a robot and make sure we no longer see the "invalid module" modal.
  • Make sure we still handle known modules like before.

Changelog

  • Use the select option of react UseQuery to filter out unknown modules

Review requests

Risk assessment

low

@vegano1 vegano1 requested a review from brenthagen May 23, 2024 18:48
@vegano1 vegano1 marked this pull request as ready for review May 23, 2024 18:48
@vegano1 vegano1 requested a review from a team as a code owner May 23, 2024 18:48
@vegano1 vegano1 requested a review from sfoster1 May 23, 2024 18:48
Copy link
Contributor

@brenthagen brenthagen left a comment

Choose a reason for hiding this comment

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

LGTM, guards us a bit against modules outside the type system

react-api-client/src/modules/useModulesQuery.ts Outdated Show resolved Hide resolved
@vegano1 vegano1 force-pushed the RABR-316-filter-unknown-modules branch from 6f3c127 to 62ba85d Compare May 23, 2024 20:02
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

nice!

@vegano1 vegano1 merged commit 39dee3a into edge May 23, 2024
8 checks passed
@vegano1 vegano1 deleted the RABR-316-filter-unknown-modules branch May 23, 2024 20:20
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.

3 participants