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

Progress API percentage is ambiguous #46743

Closed
rebornix opened this issue Mar 27, 2018 · 4 comments
Closed

Progress API percentage is ambiguous #46743

rebornix opened this issue Mar 27, 2018 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@rebornix
Copy link
Member

Re #46458

Based on the code sample

    setTimeout(() => {
        progress.report({ percentage: 10, message: "still going..."});
    }, 1000);

    setTimeout(() => {
        progress.report({ percentage: 50, message: "still going harder..."});
    }, 2000);

    setTimeout(() => {
        progress.report({ percentage: 90, message: "almost there..."});
    }, 3000);

I would think the percentage here represents the overall progress of the task while after reading the documentation (and watched the real behavior), the percentage value will actually be summed up.

@bpasero
Copy link
Member

bpasero commented Mar 28, 2018

Yes, this is as designed. There are two main reasons:

  • we do not want to allow to show negative progress (e.g. you jump from 80% to 20%)
  • more importantly we think that absolute progress is much harder to implement if you have two independent running tasks that finish in any order you need to synchronise somehow to know how much progress to report

@bpasero bpasero closed this as completed Mar 28, 2018
@bpasero bpasero added the *as-designed Described behavior is as designed label Mar 28, 2018
@bpasero
Copy link
Member

bpasero commented Mar 28, 2018

Maybe part of the confusion is the name percentage that seems to indicate an absolute value. @jrieken should we rename this to worked instead or some other name that makes the relative progress more clear?

@jrieken
Copy link
Member

jrieken commented Mar 28, 2018

Yeah, discussed that with @joaomoreno yesterday and came to the same conclusion. I would go for increment because that leave no room for interpretation...

@jrieken jrieken reopened this Mar 28, 2018
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed *as-designed Described behavior is as designed labels Mar 28, 2018
@bpasero bpasero added this to the March 2018 milestone Mar 28, 2018
@bpasero
Copy link
Member

bpasero commented Mar 28, 2018

Verify: I renamed percentage to increment to report progress increments.

@rebornix rebornix added the verified Verification succeeded label Mar 30, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 12, 2018
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants