Skip to content

Conversation

@AndreasArvidsson
Copy link
Member

Since we don't have input validation we get these kind of errors to frequently:
#2685

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner November 20, 2024 02:09
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

I think validation should be done during the validation stage in

export function ensureCommandShape(args: unknown[]): Command {
, rather than sprinkled all over our codebase. Is there a reason we can't do the validation there? I'm guessing it's simpler to it in these places where we've already drilled into the payload, but I still think it pollutes the code base and we'd have to remove it once we do proper schema validation

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Dec 1, 2024

I rather not add an additional place where we need to drill down and create comprehensive switch cases for every single action, modifier, and scope. This was a very easy solution for a bad ux. Doing it properly would of course include schema validation.
It's only in three places. I could leave a link to the schema issue or link to the places where we have done this from the issue?

#983

@pokey
Copy link
Member

pokey commented Dec 12, 2024

update from meet-up: add // FIXME: remove once we have schema validation (#983) to each of these

@AndreasArvidsson
Copy link
Member Author

fix me comments added

@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit a8613a9 Dec 13, 2024
15 checks passed
@AndreasArvidsson AndreasArvidsson deleted the inputValidation branch December 13, 2024 19:41
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