arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.33k stars 394 forks source link

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

Closed giacomocusinato closed 1 day ago

giacomocusinato commented 3 weeks ago

Motivation

Closes: arduino/arduino-ide#2547

Change description

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

Other information

Reviewer checklist

giacomocusinato commented 2 weeks ago

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 https://github.com/arduino/arduino-ide/pull/2500