rokucommunity / rokucommunity/vscode-brightscript-language

Extension timing out when device compile times are long

Open
#682 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
132
Forks
60
Avg merge
13h 53m
Merged PRs (30d)
20

Description

We have an app that takes ~11s to compile on a (low-end) device:

01-26 13:59:16.054 app  [scrpt.ctx.cmpl.time] Compiled '[APP_NAME_HERE]', id 'dev' in 11746 milliseconds (BCVer:0)
01-26 13:59:16.136 app  [scrpt.proc.mkup.time] Processed markup dev '[APP_NAME_HERE]' in 9 milliseconds
01-26 13:59:16.152 app  [beacon.signal] |AppCompileComplete --------> Duration(12993 ms)
01-26 13:59:16.165 app  [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
01-26 13:59:16.179 app  [beacon.signal] |AppSplashInitiate ---------> TimeBase(14 ms)
01-26 13:59:16.879 app  [beacon.signal] |AppSplashComplete ---------> Duration(700 ms)

When we enable run_as_process=true in our manifest, that compile time doubles, and we start hitting errors like this:

------ Compiling dev '[APP_NAME_HERE]' ------
DebugServer: Encountered an issue during the publish process
DebugServer: Error: Debug session encountered an error
    at BrightScriptDebugSession.launchRequest (/path/to/.vscode/extensions/rokucommunity.brightscript-2.60.0/node_modules/roku-debug/dist/debugSession/BrightScriptDebugSession.js:419:23)

The workaround we've had for this is to edit this file, and then it starts working:

// ~/.vscode/extensions/rokucommunity.brightscript-2.60.1/node_modules/roku-debug/dist/debugSession/BrightScriptDebugSession.js:595:31

        let didTimeOut = false;
        await Promise.race([
            isConnected,
            util_1.util.sleep(10000).then(() => {
//                            ^^^^^----- we edit this value to "100000"
                didTimeOut = true;
            })
        ]);

But this is always undone whenever there's an update. So it would be nice to get this sorted in the source code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the source corresponding to node_modules/roku-debug/dist/debugSession/BrightScriptDebugSession.js, especially launchRequest and the timeout around line 595. Reproduce with a device compile longer than 10 seconds and inspect the existing debug-session tests or test entry points. Done means long device compiles no longer hit the timeout, with coverage for the affected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.