Skip to content

Web hex view: stale answers change nothing, no dump hides the panel (1.43.1) - #94

Merged
compot-dev merged 1 commit into
mainfrom
hexview-fixes
Nov 16, 2026
Merged

compot-dev merged 1 commit into
mainfrom
hexview-fixes

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

These are the two minor findings left from #88 (answered there).

  • Stale answers: hexLoad() now checks the request number before it touches any state. An answer to an older request no longer sets hx.size or resets hx.off on a 416, and draws nothing. Before, such an answer could make Go refuse a valid address once.
  • Service restart: render() hides the panel when the state has no file and nothing is running. The server sets file empty only on a fresh start. hexClose() also drops a part still coming (hx.req++), so an open page no longer keeps the old dump's bytes.
  • Version 1.43.1, CHANGELOG.

Checked in Docker:

  • The websim page check covers both.
  • All tests pass.
  • native, LIBUSB=1 and musl x86_64/arm/mipsel/mips build with 0 warnings.

…panel

An answer that comes after a newer request no longer sets the dump size
or goes back to address 0 (Go could then refuse a valid address). A
state with no dump, after the service started again, hides the panel and
drops a part still coming, instead of keeping the old bytes.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Prevent stale hex responses and clear the panel when no dump exists

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Ignore outdated hex responses before they can change the dump size or address.
• Hide and clear the hex panel when an idle state has no dump, invalidating pending requests.
• Update the websim page check and release notes for version 1.43.1.
Diagram

graph TD
  State["Server state"] --> Render["Render state"] --> File{"Dump present?"}
  File -->|no| Close["Close hex view"] -->|hide and clear| Panel["Hex panel"]
  File -->|yes| Load["Load hex page"] --> Range["Range response"] --> Current{"Latest request?"} -->|yes, draw| Panel
Loading
High-Level Assessment

Keep the request-number guard and explicit close path: they fit the existing hex-view lifecycle and prevent both stale response mutations and retained bytes. Cancelling fetches alone would not replace the response-order check.

Files changed (4) +15 / -6

Bug fix (1) +4 / -2
web_page.htmlDiscard stale hex responses and close absent dumps +4/-2

Discard stale hex responses and close absent dumps

• Checks request identity before processing response status or size, so older answers cannot reset the address or alter dump metadata. An idle state without a file now hides and clears the panel while invalidating an in-flight page request.

src/web_page.html

Tests (1) +4 / -3
websim.cCheck the served page for both hex-view safeguards +4/-3

Check the served page for both hex-view safeguards

• Extends the existing served-page source checks to require the early stale-response guard, conditional drawing, and close path for states without a dump. These are source-presence checks rather than simulated asynchronous browser interactions.

tests/websim.c

Documentation (1) +6 / -0
CHANGELOG.mdDocument the 1.43.1 hex-view fixes +6/-0

Document the 1.43.1 hex-view fixes

• Adds release notes describing stale-answer handling and clearing the panel after a service restart.

CHANGELOG.md

Other (1) +1 / -1
main.cSet the version to 1.43.1 +1/-1

Set the version to 1.43.1

• Bumps the version string reported by the application.

src/main.c

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 854494d into main Nov 16, 2026
9 checks passed
@compot-dev
compot-dev deleted the hexview-fixes branch November 16, 2026 00:00
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