Repository navigation
fix: scan deadline grace, callback parse guard, per-scan health (0.8.0b2) - #3
Merged
Merged
Conversation
…0b2) - worker: add SCAN_TIMEOUT_GRACE_SECONDS (15s) to the parent's scan_timeout_seconds kill limit so the child's own deadline closes TWAIN and reports its error before forced termination. - worker: _send_callback skips callback URLs that urlparse rejects instead of raising after the job completed. - scanlink.js: startScan() health-checks before every scan POST, so a stale preferred transport falls back and an unreachable helper reports helper_unavailable/insecure_origin rather than scan_request_uncertain. - tests: child graceful-timeout fixture and regression; callback parse test. - docs, CHANGELOG, VERSION 0.8.0b2, tracker (records that callbacks are currently never delivered because the serialized job omits callback_url). 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.
Follow-up fixes from the review of the 0.8.0b1 stress work. VERSION is now 0.8.0b2; the 0.8.0b1 tag and artifacts are untouched.
Fixes
worker.py): the parent now kills the scan process atscan_timeout_seconds+SCAN_TIMEOUT_GRACE_SECONDS(15s), not exactly atscan_timeout_seconds. The child's own deadline starts later, after startup, so before this the parent always force-terminated it first. The child never got to close the TWAIN source or report its own error.gui_task_timeout_secondsis unchanged.worker.py):_send_callbackskips a URL thaturlparserejects (e.g.http://[) instead of raising after the job is already completed.static/scanlink.js):startScan()now checks/healthbefore every scan POST, not only the first. A stale preferred transport (HTTPS gone, HTTP healthy) falls back instead of failing every later scan. An unreachable helper reportshelper_unavailable/insecure_origininstead ofscan_request_uncertain. The scan POST is still sent only once.Also in this branch
0.8/stress_fixesthat never reachedmain(0.8.0b1 publication and paired DjangoLux acceptance records), cherry-picked so the tracker and architecture docs don't diverge.Known issue, not changed here
Callbacks are never delivered, and haven't been since 36249b6 (2026-04-28):
_process_jobpasses the serialized job, which omitscallback_url, to_send_callback. The developer guide still promises delivery. Turning it back on changes production behavior, so it needs an owner decision. It's recorded intracker.md.Testing
python -m unittest discover -s tests -t .: 42 tests OK, 1 Windows-only skip.scanlink.jschecked with a local Node harness using mocked fetch: 4/4 scenarios pass (the 0.8.0b1 client fails 2: stale-transport fallback and helper-closed message).tests/windows_install_smoke.ps1, physical TWAIN scanner, real browser policies.Follow-up
DjangoLux's
scan_button.jsshould get the same per-scan health check if it shares the stale-preferred-transport logic.🤖 Generated with Claude Code