Commit8058d4b4Recorded7 May 2026Repositorysigil-websocket

Check browser WebSocket readiness in WASM

Message

Update the WASM WebSocket connection predicate to consult the browser bridge's actual socket OPEN state. This prevents Sigil-side code from sending IRC commands before the browser WebSocket has opened.

Verification: Enclave WASM IRC smoke and live-wrapper login/history reproductions.

Changed
 src/sigil/websocket/connection.sgl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Diff
src/sigil/websocket/connection.sglmodified
@@ -308,7 +308,12 @@
308
;;; Check if connection is open
309
(define (ws-connected? conn)
310
(: ws-connection? -> boolean?)
311
(eq? (ws-connection-state conn) 'open))
+311
(and (eq? (ws-connection-state conn) 'open)
+312
(cond-expand
+313
(wasm
+314
(wasm-websocket-open? (ws-connection-socket conn)))
+315
(else
+316
#t))))
317
318
;;; Send a text message
319
(define (ws-send conn message)