Skip to content

UpdateManager: reset force flag for normal firmware updates - #19

Open
jamesmulcahy wants to merge 2 commits into
NSPManager:develfrom
jamesmulcahy:fix/clear-force-update-flag
Open

jamesmulcahy wants to merge 2 commits into
NSPManager:develfrom
jamesmulcahy:fix/clear-force-update-flag

Conversation

@jamesmulcahy

Copy link
Copy Markdown
Contributor

Summary

firmware_update_force sets UpdateManager::_force_update = true, but nothing ever sets it back to false. After one forced update in a boot (successful updates reboot, so this mainly bites when it fails), every later firmware_update command also runs as forced: it clears the stored firmware and LittleFS checksums and reflashes even when the panel is already up to date.

This sets _force_update = false when a normal firmware_update command starts, so the flag always reflects the command that started the current update task. The assignment happens before the task is created and only when no update task is running, so there is no race with the task reading it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u

jamesmulcahy and others added 2 commits September 13, 2026 20:46
_force_update is set by firmware_update_force but never cleared, so every
later firmware_update in the same boot also ran as a forced update
(clearing stored checksums and reflashing even when up to date). Clear it
when a normal firmware_update command starts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u
The build for original_sonoff rewrote the lockfile target from esp32s3
to esp32; it was committed by mistake.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u
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.

1 participant