{"record":{"id":"3ab3e26e848b5413","repo":"hcengineering/platform","slug":"wrong-video-options-specified","errorCode":null,"errorMessage":"Wrong video options specified","messagePattern":"Wrong video options specified","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"desktop/src/ui/screenShare.ts","lineNumber":125,"sourceCode":"            reject(new Error('No source selected'))\n          }\n        },\n        (val) => {\n          if (val != null) {\n            wasSelected = true\n            if (options === undefined) {\n              options = {}\n            }\n\n            if (options.resolution === undefined) {\n              options.resolution = ScreenSharePresets.h1080fps30.resolution\n            }\n\n            const constraints = screenCaptureToDisplayMediaStreamOptions(options)\n\n            if (constraints.video === undefined) {\n              log.error('Wrong video options specified')\n              throw new Error('Wrong video options specified')\n            }\n\n            constraints.video = {\n              mandatory: {\n                ...(typeof constraints.video === 'boolean' ? {} : constraints.video),\n                chromeMediaSource: 'desktop',\n                chromeMediaSourceId: val\n              }\n            } as any\n\n            void window.navigator.mediaDevices.getUserMedia(constraints).then((stream) => {\n              const tracks = stream.getVideoTracks()\n              if (tracks.length === 0) {\n                log.error('No video track found')\n                throw new TrackInvalidError('No video track found')\n              }\n              const screenVideo = new LocalVideoTrack(tracks[0], undefined, false, {\n                loggerName: this.roomOptions.loggerName,","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/desktop/src/ui/screenShare.ts#L107-L143","documentation":"BackRPC server's checkAlive loop in foundations/net/packages/backrpc/src/server.ts detects that a registered client has not been seen for longer than its perClientAliveTimeoutSeconds and logs this warning before tearing the connection down via handleClose(..., true). The client is marked dead and its mappings are cleaned up; any pending calls to it will fail.","triggerScenarios":"A client's lastSeen timestamp exceeds perClientAliveTimeoutSeconds * 1000 — i.e. no keepalive/heartbeat or any traffic from that client within its timeout window while the periodic check runs.","commonSituations":"Client process crashed or was killed without closing the socket; network partition, NAT/firewall dropping idle connections; client machine asleep or suspended; misconfigured keepalive interval longer than the server's per-client timeout.","solutions":["Ensure the client sends heartbeats/keepalives more frequently than perClientAliveTimeoutSeconds.","Check client logs/process health — the client likely crashed, hung, or its machine went to sleep.","Tune timeouts: raise perClientAliveTimeoutSeconds server-side or lower the client heartbeat interval to leave headroom.","Implement automatic client reconnection with re-registration after being marked dead."],"exampleFix":"// before\nsetInterval(() => sendHeartbeat(), 120_000) // 120s > server timeout of 60s\n// after\nsetInterval(() => sendHeartbeat(), 15_000) // well under the 60s per-client timeout","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"client.on('closed', async (clientId) => {\n  if (wasMarkedDeadByTimeout(clientId)) {\n    await backoffReconnect() // reconnect and re-register with the BackRPC server\n  }\n})","preventionTips":["Send client heartbeats at an interval well below perClientAliveTimeoutSeconds (e.g. 1/4 of the timeout).","Implement automatic reconnection with exponential backoff and re-registration on the client.","Avoid long-blocking work on the client's event loop that can starve heartbeat sends.","Monitor and alert on 'marking as dead' warnings to detect flaky clients or networks early."],"tags":["backrpc","timeout","keepalive","connection-dropped"],"backgroundTag":"client-timeout-marked-dead","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}