Today I must have spent an extra +20 minutes on this >:(
Which would pbly add up to hours/days over the years. There are some hardware like the ESP8266 Wemos which fails to upload more often than not. The success rate is about 7/1 yeah... before you suggest that it's an issue with the hardware I have dozens of these and it's the same for all.
Also I saw another topic where the @p request it for the code not to be recompiled each and every single time when there is no change this just makes the situation worse.
There should be an autoretry on uploads with a number to set between 0-999 it would save us tons of time.
There are some hardware like the ESP8266 Wemos which fails to upload more often than not.
Perhaps that is a problem that the people making ESP8266 boards and firmware should try to fix...
(oops; they're not the Arduino folks. Arduino doesn't have any ESP8266-based products! Even the upload code that would theoretically retry at the appropriate level isn't from Arduino...)
The AVR "upload retries" are apparently in the wrong place, so the chances that a retry will actually work are slim (but the AVR uploading is more reliable, so I spend more time waiting for doomed retry attempts to stop than I do having to manually retry uploads.)
I have placed the retry before the call to the actual upload function so its just like a manual retry.
And In my version the compile before upload is removed.