Skip to content

Progress bar reset does not do anything #124

Closed

Description

@Bricktheworld

Hello, I'm not sure if I am doing something wrong however I need the progress bar to be able to dip to a lower percentage when necessary. I am calling "stepTo", however, this does not move the progress bar down if a lower percentage is provided. If I try to call "reset", the bar simply ignores that call and continues on. Is this behavior intended? If so is there a way a change can either be implemented or I can modify the library? I am using Arch Linux with alacrity in the zsh shell.

Activity

  1. Bricktheworld commented on Feb 3, 2022

    @Bricktheworld
    Author

    Actually, I'm sorry, this is my mistake, using the ProgressBarBuilder to continuously update has fixed the issue.

  2. ctongfei commented on Feb 3, 2022

    @ctongfei
    Owner

    Hello @Bricktheworld , this does seem like a bug to me. Can you paste your minimized snippet here?

  3. Bricktheworld commented on Feb 8, 2022

    @Bricktheworld
    Author

    Hey @ctongfei, sorry for the late response! Here is a simple example that should show how it can be reproduced, please let me know if you are able to replicate and if you need anything else.

    int someProgress = 0;
    try (var pb = new ProgressBar("Some progress", 100)) {
         while(true) {
              Thread.sleep(500);
              if (someProgress >= 100) {
                      pb.reset();
                      someProgress = 0;
                      continue;
              }
              someProgress += 10;
              pb.stepTo(someProgress);
         }
    }
    
  4. ctongfei commented on Sep 10, 2022

    @ctongfei
    Owner

    Hi @Bricktheworld sorry for the late response. This is a bug due to a recent optimization that only refreshes the progress bar if it went forward. It did not account for the condition where it stepped backward when calling stepTo. This will be fixed in the next version. Thanks!

  5. added this to the 0.9.4 milestone on Sep 10, 2022
  6. self-assigned this
    on Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions