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

Clear updater state on any error #6325

Merged
merged 2 commits into from
Jul 21, 2019

Conversation

earlephilhower
Copy link
Collaborator

Fixes #2090

The Updater checks that an update isn't already in progress on ::begin,
but when an error happens in the middle of an upload it's impossible to
actually reset this flag w/o a reboot.

Reset the state members (esp. _size) on any error condition so
that you can restart the transfer with a new ::begin. Any error
condition is fatal, anyway, so there is no reason not to clear the
current state at that point.

Fixes esp8266#2090

The Updater checks that an update isn't already in progress on ::begin,
but when an error happens in the middle of an upload it's impossible to
actually reset this flag w/o a reboot.

Reset the state members (esp. _size) on any error condition so
that you can restart the transfer with a new ::begin.  Any error
condition is fatal, anyway, so there is no reason not to clear the
current state at that point.
@earlephilhower earlephilhower added this to the 2.6.0 milestone Jul 21, 2019
@earlephilhower earlephilhower merged commit 5d5cd1d into esp8266:master Jul 21, 2019
@earlephilhower earlephilhower deleted the updater-clear branch July 21, 2019 23:22
@bertmelis
Copy link

bertmelis commented Jul 22, 2019

I believe I solved this by calling ::end on error.

end calls _reset:

So imho the webupdater should be fixed and not the updater. I didn't look into the issue though.

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.

WebUpdater problem
4 participants