Closed Bug 927330 Opened 11 years ago Closed 11 years ago

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

Categories

(Firefox OS Graveyard :: Gaia::Clock, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

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

VERIFIED FIXED
blocking-b2g koi+
Tracking Status
b2g-v1.2 --- verified

People

(Reporter: iliu, Assigned: gnarf)

References

Details

Attachments

(2 files)

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.
Attached video 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
Attached patch patch v1Splinter Review
Attachment #817903 - Flags: review?(mike)
Attachment #817903 - Flags: feedback?(waldron.rick)
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+
master: https://github.com/mozilla-b2g/gaia/commit/39b8e49db38c9277c58cf72a0de2bd72398052d4
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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)
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
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
Changing tracking flag to verified based on comment 12.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: