Closed nitishgargiitd closed 4 years ago
What version of mpb do you use?
a55da8df10b6d8d8172eea63c25e65bf975806d6 - v5.2.2
we also tried to upgrade the version of mpb to the latest, i.e. 03ab54c25b65ba834c03a30bf355110245ebb0b9 - July 17th commit and no success
You somehow getting Current:-21
, this is a root cause of panic.
makes sense, but how? and why it's happening for only few people, and it's happening consistently on their machine.
Do you use SetCurrent
method? If yes double check its usage.
I believe that panicking in this case is correct behavior, because otherwise you could end up displaying wrong data silently and never detect the bug.
Yes, we are using SetCurrent, what should I check about it, anything specific you have in mind that is causing this issue.
Most probably you're setting negative current value at some point. You should probably check what causes it to be negative.
got it, let me check.
Ahh I think I got it. we are doing something like this
bar.SetCurrent(time.Now().Unix() - someUTCTimestampFromDB)
So on those few machines, machine times must be messed up and hence causing this to be negative.
Bug on our side, thanks for your help, you are awesome and really fast!
We launched a developer tool using this lib last week, 2 users reported the error below, but it works for most of us. We are distributing a compiled binary through homebrew, so we can be sure everyone is running the same go binary.
One of them is using iTerm2 3.3.6, I tested against the same version, but works fine for me
Our implementation looks very similar to one in https://github.com/vbauerster/mpb/blob/master/_examples/complex/main.go