Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questionable implementation of getProcessId #12770

Closed
bpasero opened this issue Sep 27, 2016 · 3 comments
Closed

Questionable implementation of getProcessId #12770

bpasero opened this issue Sep 27, 2016 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority terminal General terminal issues that don't fall under another label verified Verification succeeded

Comments

@bpasero
Copy link
Member

bpasero commented Sep 27, 2016

Testing #12595

See https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/api/node/extHostTerminalService.ts#L44

public get processId(): Thenable<number> {
    this._checkDisposed();
    if (this._processId) {
        return Promise.resolve<number>(this._processId);
    }
    setTimeout(() => {
        return this.processId;
    }, 200);
}

First of all, if you reach the setTimeout, there is no return value after all (just undefined). And then, how do you know that the process id is there after 200ms?

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority terminal General terminal issues that don't fall under another label labels Sep 27, 2016
@Tyriar Tyriar added this to the September 2016 milestone Sep 27, 2016
@Tyriar
Copy link
Member

Tyriar commented Sep 29, 2016

Inside the promise it recurses as it returns the getter not the backing value, I was planning on removing the setTimeout in October #12434

Fixing the bug now though.

@bpasero
Copy link
Member Author

bpasero commented Sep 29, 2016

And the 200ms is just a guess?

@bpasero bpasero added the verified Verification succeeded label Sep 29, 2016
@Tyriar
Copy link
Member

Tyriar commented Sep 29, 2016

Yes, it likely only needs much less than that thought. I'll improve it in October.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority terminal General terminal issues that don't fall under another label verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants