[Clock][Timer] The countdown is not normally(un-countdown) while clicking pause/resume button quickly.

VERIFIED FIXED

Status

Firefox OS
Gaia::Clock
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: iliu@mozilla.com, ianliu.moz@gmail.com, Assigned: gnarf)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-b2g:koi+, b2g-v1.2 verified)

Details

Attachments

(2 attachments)

STD:

1. Launch Clock app
2. Click Timer tap
3. Set a time and click start button
4. Clicking pause/resume button quickly

Expected:
The countdown should work normally.

Actual:
Sometimes, the countdown reset with one second.
Created attachment 817727 [details]
countdown is not normal

Please reference the video. It will help you to reproduce the issue.
Nominating koi+.. Because this may affect the accuracy of the timer.
blocking-b2g: --- → koi?
Assignee: nobody → waldron.rick
Assignee: waldron.rick → gnarf37
(Assignee)

Comment 3

5 years ago
Created attachment 817903 [details] [diff] [review]
patch v1
Attachment #817903 - Flags: review?(mike)
Attachment #817903 - Flags: feedback?(waldron.rick)
(Assignee)

Comment 4

5 years ago
Dear Triage: This fix is pretty small, and is backed up by good units - I second the suggestion for koi+
Comment on attachment 817903 [details] [diff] [review]
patch v1

Review of attachment 817903 [details] [diff] [review]:
-----------------------------------------------------------------

A non-blocking nit but otherwise: f=me

::: apps/clock/js/timer.js
@@ +67,3 @@
>  
> +      // wait for the number of ms remaining until the next second ticks
> +      setTimeout(this.tick.bind(this), ((end - now) % 1000) || 1000);

Maybe store the value of `end - now`?
Attachment #817903 - Flags: feedback?(waldron.rick) → feedback+
Comment on attachment 817903 [details] [diff] [review]
patch v1

Review of attachment 817903 [details] [diff] [review]:
-----------------------------------------------------------------

I second Rick's suggestion; maybe name it "remaining"? Other than that, this looks good to me--it prevents the bug, and the tests prove it.
Attachment #817903 - Flags: review?(mike) → review+
(Assignee)

Comment 7

5 years ago
master: https://github.com/mozilla-b2g/gaia/commit/39b8e49db38c9277c58cf72a0de2bd72398052d4
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Blocks: 907177
Hi Corey,

Are we sure that the accuracy of the clock of the timer is fixed?

Please chime in. I agree that the fix is small.

I am inclined to take it if we can be sure that the issue is fixed.
Flags: needinfo?(gnarf37)
(Assignee)

Comment 9

5 years ago
I'm as sure as I'm going to be.  I wrote tests to cover its accuracy down to the millisecond to go with the patch.
Flags: needinfo?(gnarf37)
koi+ based on comments 8 & 9.
blocking-b2g: koi? → koi+
Uplifted 39b8e49db38c9277c58cf72a0de2bd72398052d4 to:
v1.2: d69efda488e60b09a00d219220df2dc80cb5b634
status-b2g-v1.2: --- → fixed

Comment 12

5 years ago
Thanks! Verified it.

* Test Build:
 - Gaia:     04ee9e4430b25ba2c38752d3897f0ee5e2a6ab80
 - Gecko:    http://hg.mozilla.org/releases/mozilla-aurora/rev/52f24889dccc
 - BuildID   20131027004003
 - Version   26.0a2
Status: RESOLVED → VERIFIED

Comment 13

5 years ago
Changing tracking flag to verified based on comment 12.
status-b2g-v1.2: fixed → verified
You need to log in before you can comment on or make changes to this bug.