From 44c7a636231d5fcde87187164cfc0b51d66f5898 Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Sun, 21 Jun 2026 11:33:00 -0500 Subject: scrypted: log end-of-method state for lifecycle calls + bootstrap exception start() previously logged only at entry, so a silent throw between 'Scrypted Viewport up' and 'this.running = true' would leave us guessing. Add explicit end-of-method logs with the post-write state, plus a try/catch around bootstrap that surfaces the exception message before re-throwing. This will tell us whether start() reaches its set this.running=true on script load (i.e. whether the prototype state-proxy write fires) or whether bootstrap is silently failing somewhere mid-way. --- scrypted/scrypted-viewport.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scrypted/scrypted-viewport.ts b/scrypted/scrypted-viewport.ts index 8df6371..861e665 100644 --- a/scrypted/scrypted-viewport.ts +++ b/scrypted/scrypted-viewport.ts @@ -424,15 +424,21 @@ class ScryptedViewportProvider extends ScryptedDeviceBase // we can drop the other (and the logging). async start() { - this.console.log(`lifecycle: start() called (running=${this.running})`); + this.console.log(`lifecycle: start() called (running=${this.running}, on=${this.on})`); if (this.running) return; - await this.bootstrap(); + try { + await this.bootstrap(); + } catch (e) { + this.console.error(`lifecycle: bootstrap threw:`, (e as Error).message); + throw e; + } this.running = true; this.on = true; + this.console.log(`lifecycle: start() complete — running=${this.running}, on=${this.on}, nativeId=${this.nativeId}`); } async stop() { - this.console.log(`lifecycle: stop() called (running=${this.running})`); + this.console.log(`lifecycle: stop() called (running=${this.running}, on=${this.on})`); if (!this.running) return; drainShutdownCleaners(this.console, "stop"); this.viewports.clear(); @@ -440,6 +446,7 @@ class ScryptedViewportProvider extends ScryptedDeviceBase this.streams.clear(); this.running = false; this.on = false; + this.console.log(`lifecycle: stop() complete — running=${this.running}, on=${this.on}`); } async turnOn() { -- cgit v1.2.3