Repository navigation
fix(firmware): don't judge a pending update on a reconnect before reset - #35
Merged
Merged
Conversation
tedge_fw_on_connected() runs on every session start. If the MQTT session dropped and came back after the download had written the marker but before the reset, the old image was still running, so the check read the update as rolled back, reported it, and cleared the marker. The new image then booted with nothing to report, and the operation stayed EXECUTING. Skip the check while this boot's own update is running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while testing #34 on an ESP32-C6 (NuttX).
Problem
tedge_fw_on_connected()runs on every session start. In one of 20 test installs, the MQTT session timed out during the download and reconnected just after the download thread had written the pending marker, before the reset:The old image was still running, so the check took the update for a rollback and cleared the marker. The new image booted with nothing to report, and the operation stayed EXECUTING.
Fix
tedge_fw_on_connected()returns early whilejob_runningis set. The marker belongs to the update still in progress on this boot, and the next boot judges it.Testing
-Werror, and its tests pass.🤖 Generated with Claude Code