fix: zombie jobs + function collision killed Quick Scan clicks - #238
Merged
Conversation
…ge (#237 follow-up) Two stacked bugs produced 'scan does nothing / no open ports': 1. Function name collision: scan_runtime.js and discovery_ui.js both defined initializeDiscoveryUI; discovery_ui loads second and overrode the version that wires the Quick Scan button. The surviving click listener emitted with a stale socket reference, so clicks did nothing. Renamed scan_runtime's copy to initializeScanButtonWiring and call both from both bootstraps. 2. Zombie jobs: a page closed mid-scan left its job marked 'running' forever. On every future connect, sync_state reported isScanning=true, disabling all scan buttons. Connect/get_initial_data now verify the owner sid is still in broadcaster._connected_sids before reporting an active scan; disconnected owners' jobs are completed and torn down. Also: reload the page on socket.io transport reconnect (module closures hold the dead session's socket otherwise). Verified end-to-end: click -> quick scan -> deep scan -> 16 open ports + CVEs rendered in the discovery table. Suite back to the 16 known-red baseline.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Two stacked bugs made scans appear dead
1. Function name collision (root cause of silent clicks)
scan_runtime.jsanddiscovery_ui.jsboth definedinitializeDiscoveryUI. Load order meant discovery_ui's version overrode scan_runtime's — and the overridden version was the one that wired the Quick Scan button. The surviving click listener emitted on a stale socket reference, so clicks did nothing.Fix: renamed scan_runtime's copy to
initializeScanButtonWiring; both bootstraps now call it alongside discovery_ui's version.2. Zombie jobs disabled all scan buttons
A page closed mid-scan left its job marked
runningforever. Every future page load then receivedsync_state {isScanning: true}from the connect bridge, disabling all scan buttons with no explanation.Fix: connect/get_initial_data now verify the owner sid is still in
broadcaster._connected_sidsbefore reporting an active scan; disconnected owners' jobs are completed and torn down.Also added: reload the page on socket.io transport reconnect (module closures hold the dead session's socket).
Verified end-to-end
Click → quick scan → deep scan → 16 open ports + CVEs rendered in the discovery table. Suite back to the 16 known-red baseline (309 passed).