upgrade(): log the response just read, not a stale variable - #8
Open
Cybis320 wants to merge 1 commit into
Open
Conversation
The completion loop reads each response into `data` but logs `reply`, which was last assigned in the upload loop above and never changes afterwards. Every iteration therefore logs the same stale value instead of the upgrade progress the line is meant to record. Debug-level only, so it is not visible by default, but it makes the upgrade log actively misleading when someone does turn it on: the Ret values recorded can repeat or show a value the camera never sent at that point. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more' |
PR Summary by QodoLog current firmware upgrade response
AI Description
High-Level Assessment
Files changed (1)
|
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.
upgrade()'s completion loop reads each response intodatabut logsreply:replywas last assigned in the upload loop above and is never reassigned here, so every iteration logs the same stale value rather than the upgrade response the line is meant to record.Debug-level only, so it isn't visible by default — but it makes the upgrade log actively misleading once enabled, since the
Retvalues recorded can repeat or show a value the camera never sent at that point. I hit this while tracing why firmware upgrades on a GK7205V200 camera reported inconsistent results, and the log sent me the wrong way for a while.One-line change, no behaviour difference outside logging.
Thanks for maintaining this after the original repo went away — the
receive_jsontry/except and theget_commandbinary handling both fixed real crashes for us.