Skip to content

v0.4.1 — window times no longer one minute early

Choose a tag to compare

@davorinpavlica davorinpavlica released this 02 Aug 09:39
31757e7

Patch on v0.4.0. Window times could show one minute early and stay that way.

  • The /usage text fallback reads a phrase that is cut off at whole minutes. "Resets in 4 hr 15 min" really covers anything up to 4h15m59s, so computing exactly 4h15m landed up to 59 seconds early, which writes as a full minute early.
  • On its own that was self correcting, because the next live reading replaced it. The sticky anchor added in v0.4.0 changed that: a live time only one minute later now counts as a slide and is held, so the wrong minute stuck for the whole window.
  • The fallback now rounds up to the next whole minute. Real reset times land on whole minutes, so this recovers exactly what the phrase cut off.
  • Rounding up is also the safe direction. An earlier live time is always adopted, so a late guess corrects itself while an early one does not.

Observed before the fix: the meter reported 14:10:00 while /queue-status held 14:09 across repeated calls. After: 14:10, stable.