https://gitlab.synchro.net/main/sbbs/-/commit/b6c2ca2e50cb8ca5bcc1af38
Modified Files:
src/sbbs3/js_global.cpp
Log Message:
require(): don't report "symbol not defined" when the load was aborted
When a web client disconnects, the web server's operation callback aborts
the running script without setting the terminated flag. If that happens
while require() is loading a file, js_load() fails with no exception
pending and require() then reported the requested symbol as missing, e.g.:
Failed to load event module nodelist: Error: symbol 'USER_DELETED' not
defined by script 'sbbsdefs.js'
logged by webv4's events.ssjs when a crawler dropped the event stream.
Worse, the uncatchable abort became a catchable exception. The js_IsTerminated() check added in 78b2682ec8 (urge-22-door, 2023-12-14)
doesn't cover this path, since the disconnect abort never sets the flag.
Only check for the symbol after a successful load; a failed load with no exception pending propagates as the abort it is.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>