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

Add additional client-side restrictions on robot names to protect against robot-side bugs #10214

Closed
SyntaxColoring opened this issue May 5, 2022 · 5 comments · Fixed by #10318
Assignees

Comments

@SyntaxColoring
Copy link
Contributor

SyntaxColoring commented May 5, 2022

Overview

Currently, the Opentrons App validates robot names according to these rules rules similar to these:

You can use letters, numbers, spaces, special characters (!?$*) and emojis.
35 characters max

And in theory, the OT-2 can have a display name that's mostly arbitrary Unicode.

In practice, robot renaming has several bugs:

Since the OT-2 persists its display name across boots, hitting some of these bugs can have lasting effects. So, out of conservatism, in the initial release of the robot rename feature, we should limit input to names that are unlikely to trigger any of these bugs.

When these bugs have been resolved and we've had more time to vet our back-end code, we can lift these restrictions, and go back to the app's current restrictions of:

Acceptance criteria

  • The Opentrons App's robot rename field should only allow ASCII A-Z and ASCII 0-9 [edit: and ASCII lowercase a-z]. This means it should disallow spaces, special characters, and emoji.
  • The Opentrons App's robot rename field should continue to disallow names longer than 35 characters.
    • I believe the robot can safely handle ASCII names less than 63 characters long (and perhaps exactly 63—unclear). My understanding is that the current limit of 35 comes from the app's own design and testing concerns.
  • Copy should also be updated.
  • Since these new restrictions are intended to be temporary, I suggest leaving a # TODO comment pointing back to this ticket for traceability.
@koji
Copy link
Contributor

koji commented May 6, 2022

@SyntaxColoring
We changed the rules of a robot name

Choose a name for your robot. You can use letters, numbers, spaces, and these special characters: !?$*’-_.

Also, we disallow a user to use space for the first letter.

@SyntaxColoring
Copy link
Contributor Author

SyntaxColoring commented May 6, 2022

Noted, thanks. I think this ticket still stands. Anything not ASCII A-Z 0-9 [edit: and lowercase a-z] is at risk of not being handled correctly.

@mikecardarelli
Copy link

@SyntaxColoring Are lowercase letters acceptable?

@koji koji assigned koji and unassigned koji May 17, 2022
@koji
Copy link
Contributor

koji commented May 17, 2022

  • update regex

@koji
Copy link
Contributor

koji commented May 17, 2022

@SyntaxColoring Are lowercase letters acceptable?

@mikecardarelli I got confirmation from Max. The lowercase letters are acceptable.

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 a pull request may close this issue.

3 participants