From: Ian Jackson Date: Wed, 2 Jun 2021 21:30:35 +0000 (+0100) Subject: script: sse disconnection: Check the connecting status X-Git-Tag: otter-0.7.0~89 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bc92f77c95fdc3bf4ad08880250c7dc228250c82;p=otter.git script: sse disconnection: Check the connecting status Don't produce an error if the browser is reconnecting. Hopefully it will be fine soon... Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 54a258da..0d310d5c 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -2017,13 +2017,20 @@ function startup() { string_report_error('connection to server interrupted too long'); }); es.onerror = function(e) { - console.log('FOO',e,es); - json_report_error({ + let info = { updates_error : e, updates_event_source : es, updates_event_source_ready : es.readyState, update_oe : (e as any).className, - }) + }; + if (es.readyState == 2) { + json_report_error({ + reason: "TOTAL SSE FAILURE", + info: info, + }) + } else { + console.log('SSE error event', info); + } } recompute_keybindings(); space.addEventListener('mousedown', some_mousedown);