chore: remove ota_POC.py proof-of-concept (unsafe DFU activation)#6
Merged
Merged
Conversation
ota_POC.py treats VALIDATE status INVALID_STATE (0x02) as success and then activates the image, which can leave a device stuck in DFU. The maintained library src/nrf_ota/dfu.py handles this case correctly. The file was already excluded from the built wheel and is not imported anywhere; remove it and its now-dead references in pyproject.toml and CODEOWNERS. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012g2e8mr132vcizx92WsgiR
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
g4bri3lDev
approved these changes
Jul 5, 2026
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.
Summary
Removes
ota_POC.pyfrom the repo root. It is a proof-of-concept that is unsafe to run and duplicates functionality already provided correctly by the maintained librarysrc/nrf_ota/dfu.py.The hazard
In
ota_POC.py, the firmware VALIDATE step treats statusINVALID_STATE(0x02) as success:It then unconditionally calls
activate_and_reset(). For this Legacy bootloader,dfu_image_validate()returnsINVALID_STATEexactly when the received byte count does not match the image size (a data packet was dropped in transit) — it is not an alternate success. Firing Activate at that point resets the device without writing the valid-app settings and leaves it stuck in DFU. Legacy DFU cannot retransmit, so this is a real bricking-into-DFU footgun.The maintained library already documents and handles this exact case correctly in
src/nrf_ota/dfu.py(it raises a clear, retryableDFUErroronINVALID_STATEinstead of activating).Why it's safe to remove
ota_POC.pywas already excluded from the built wheel (onlysrc/nrf_otais packaged).pyproject.toml(ruffexclude) and.github/CODEOWNERSare removed as well.No changes to the library itself.
uv run pytest -qpasses (30 passed).🤖 Generated with Claude Code
https://claude.ai/code/session_012g2e8mr132vcizx92WsgiR