Skip to content

qr_decoder: report results through module_status (part of #493) - #537

Merged
NovaCode37 merged 1 commit into
NovaCode37:mainfrom
Nandika-Gupta:fix/493-qr-decoder-status
Oct 10, 2026
Merged

NovaCode37 merged 1 commit into
NovaCode37:mainfrom
Nandika-Gupta:fix/493-qr-decoder-status

Conversation

@Nandika-Gupta

Copy link
Copy Markdown
Contributor

Summary

Part of #493 (qr_decoder only). qr_decoder now reports its results through annotate instead of setting result["error"] directly, and "No QR code detected" is treated as an OK result, since the image was read fine.

Changes

  • "No QR code detected in the image" is now OK with that reason in status_reason. This also covers the case where the online API finds no code, which used to come back as an error.
  • API and network failures are ERROR, and a successful decode is OK.
  • Frontend: the QR panel only rendered something when error was set, so "no QR code" would have shown empty rows. It now shows the status reason instead (2 lines in ToolPanels.tsx, and QrResult extends ModuleStatusFields).
  • Added tests/test_qr_decoder.py with a test for each case: local decode, no QR code, API HTTP error, network error and API decode.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed

git grep -n 'result\["error"\] =' modules/qr_decoder.py now returns nothing. pytest tests/test_qr_decoder.py passes (5 tests).

Screenshots

N/A

@github-actions

Copy link
Copy Markdown

Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. pytest tests/ -q passing is the main thing I look at.

@github-actions github-actions Bot added python Pull requests that update python code javascript Pull requests that update javascript code labels Oct 10, 2026

@NovaCode37 NovaCode37 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches #493: no code in the image is an answer, an API failure is an error, and the panel now says so instead of showing nothing. Thanks.

@NovaCode37 NovaCode37 added the hacktoberfest-accepted Counts toward Hacktoberfest label Oct 10, 2026
@NovaCode37
NovaCode37 merged commit 83d7b37 into NovaCode37:main Oct 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Counts toward Hacktoberfest javascript Pull requests that update javascript code python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants