magic-wormhole / magic-wormhole.rs

Rust implementation of Magic Wormhole, with new features and enhancements
European Union Public License 1.2
645 stars 72 forks source link

Unify sending/receiving progress bar style #190

Closed afontenot closed 1 year ago

afontenot commented 1 year ago

Change the receiving end progress bar so that, like the sending end, it will only be updated every 250 ms. This avoids extremely rapid flickering that makes the ETA very hard to read.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.01 :tada:

Comparison is base (46eceb0) 43.73% compared to head (3f52efc) 43.74%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #190 +/- ## ========================================== + Coverage 43.73% 43.74% +0.01% ========================================== Files 18 18 Lines 2552 2549 -3 ========================================== - Hits 1116 1115 -1 + Misses 1436 1434 -2 ``` | [Impacted Files](https://codecov.io/gh/magic-wormhole/magic-wormhole.rs/pull/190?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=magic-wormhole) | Coverage Δ | | |---|---|---| | [cli/src/main.rs](https://codecov.io/gh/magic-wormhole/magic-wormhole.rs/pull/190?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=magic-wormhole#diff-Y2xpL3NyYy9tYWluLnJz) | `0.00% <0.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://codecov.io/gh/magic-wormhole/magic-wormhole.rs/pull/190/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=magic-wormhole) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=magic-wormhole). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=magic-wormhole)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

afontenot commented 1 year ago

Fixed - I think the test failure is bogus.

piegamesde commented 1 year ago

Yes, some tests are flaky

piegamesde commented 1 year ago

The reason this bug has happened is that all progress bar handlers are identical, but the code is duplicated all over the place. So I probably just missed that one the last time I touched the code. To prevent this from happening in the future, would you mind factoring them out into their own function? I'm thinking about something with the following signature: fn create_progress_handler(pb: ProgressBar) -> impl FnMut(u64, u64), next to create_progress_bar