Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: retry compilation if grpc client needs to be reinitialized #2548

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

Merged
davegarthsimpson merged 3 commits into main from #2547
Nov 21, 2024

Conversation

@giacomocusinato
Copy link
Collaborator

@giacomocusinato giacomocusinato commented Oct 30, 2024
edited
Loading

Motivation

Closes: #2547

Change description

Catch invalid instance error during compilation, refresh grpc client and retry.

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

This change resolves the issue where the intersection of `ServiceError` error codes of type `number` resulted in the `never` type due to conflict between number and `State` enum if `StatusObject`
@per1234 per1234 linked an issue Oct 30, 2024 that may be closed by this pull request
3 tasks
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to Arduino CLI labels Oct 30, 2024
Copy link
Contributor

@dankeboy36 dankeboy36 left a comment

Choose a reason for hiding this comment

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

It's looking great.

Why not handle the error on the backend without sending it back to the FE? Is there a technical limitation? Thank you! (Related #2500)


if (
ServiceError.isInvalidArgument(error) &&
error.details.includes('instance is no longer valid')
Copy link
Contributor

@dankeboy36 dankeboy36 Oct 30, 2024

Choose a reason for hiding this comment

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

What should happen when the selected language is, for example, German, and there is a translation for this error message for the CLI?

per1234 reacted with heart emoji
Copy link
Collaborator Author

@giacomocusinato giacomocusinato Nov 4, 2024

Choose a reason for hiding this comment

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

I'm now extracting the error type from the error metadata 👍

dankeboy36 reacted with thumbs up emoji
Copy link
Collaborator Author

Thanks for the review @dankeboy36!
You're right, would be best to handle the error directly on the backend. Initially I found a bit confusing code-wise restarting the compile stream in the same method, but I've proposed a solution now. If that works I might use the same approach with the logic in #2500

dankeboy36 reacted with thumbs up emoji

@davegarthsimpson davegarthsimpson merged commit 4cf9909 into main Nov 21, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@davegarthsimpson davegarthsimpson davegarthsimpson approved these changes

+1 more reviewer

@dankeboy36 dankeboy36 dankeboy36 left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Modification of installed core files breaks compilation

AltStyle によって変換されたページ (->オリジナル) /