Skip to content

fix: zombie jobs + function collision killed Quick Scan clicks - #238

Merged
techmore merged 1 commit into
mainfrom
fix/zombie-jobs-disable-scan-buttons
Aug 23, 2026
Merged

fix: zombie jobs + function collision killed Quick Scan clicks#238
techmore merged 1 commit into
mainfrom
fix/zombie-jobs-disable-scan-buttons

Conversation

@techmore

Copy link
Copy Markdown
Owner

Two stacked bugs made scans appear dead

1. Function name collision (root cause of silent clicks)

scan_runtime.js and discovery_ui.js both defined initializeDiscoveryUI. 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 running forever. Every future page load then received sync_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_sids before 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).

…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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@techmore
techmore merged commit 2c2f8db into main Aug 23, 2026
2 of 3 checks passed
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