[FFOS7715 v2.1] [Clock] Alarm which is repeat everyday cannot work after changing system time to an earlier one

RESOLVED WONTFIX

Status

Firefox OS
Gaia::Clock
RESOLVED WONTFIX
3 years ago
3 months ago

People

(Reporter: spreadst, Unassigned, NeedInfo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: sprd380876, PTR1_BLOCK)

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Description: Alarm which is repeat everyday cannot work after changing system time to an earlier one

Device: SPRD 7715ga
Build Identifier: 20141224175959

Steps to Reproduce:
1) Goto clock, set an alarm which is earlier than current time of the mobile.
   Set the alarm to repeat everyday
   e.g. Current time is 5:02pm. Set an alarm at 5:00pm, and repeat everyday
2) Goto setting, change the current time of the device.
   e.g. Change the current time from 5:02pm to 4:58pm

Actual Result: The alarm does not go off at 5:00pm

Expected Result: The alarm goes off at the right time

Repro frequency:10/10,100%
(Reporter)

Updated

3 years ago
Whiteboard: sprd380876
Hi Chens -

Personally i think it is a trivial issue and probably won't happen much in the real life, but still could you help to check and provide some suggestions to our partner regarding how to fix it?

Thanks

Vance
Flags: needinfo?(shchen)
Adding a 'moztimechange' event listener tells you when system time being changed, and after that event you can try |alarmDatabase.getAll().then((alarms) => {...});| [1] to get all registered alarms.
I think it might help if we update those alarms when system time gets changed.

[1]: https://github.com/mozilla-b2g/gaia/blob/master/apps/clock/js/panels/alarm/alarm_list.js#L24-L30
Flags: needinfo?(shchen)
Hi SPRD friend -

Based on the suggestion in Comment#2, is it possible for you to come out a patch first?

Thanks

Vance
Flags: needinfo?(duzc)

Comment 4

3 years ago
Created attachment 8542054 [details] [diff] [review]
Clock.patch

Comment 5

3 years ago
Hi Vance -

 There is Clock.patch in Attachment from SPRD'duzc. 
 but i thank that it isn't good for the issue.
 
 There exist the following problems:

 when the clock isn't running , don't update those alarms when system time gets changed.

Comment 6

3 years ago
please check the comment 5.
Best Regards,
Flags: needinfo?(vchen)
Hi Chens -

Could you help to check the patch to see if it correspond to what you propose?

Also i think Duzc make a point here: Will this mechanism still works if the Alarm is not running?

Thanks for your help
Flags: needinfo?(vchen)
Flags: needinfo?(shchen)
Flags: needinfo?(duzc)
This will not work when clock app isn't running, maybe force to launch clock app when you get this event is a way but I don't think that's a good one. This would be better to handle in mozAlarm API.
Flags: needinfo?(shchen)
It seems like we might need improved WebAPI support for all of this.  I sent a message to public-sysapps on this (the standardization body for mozAlarms in the form of http://www.w3.org/TR/web-alarms/), visible in the archive at http://lists.w3.org/Archives/Public/public-sysapps/2014Dec/0008.html.

Note that the API being standardized is something that requires ServiceWorkers and so would likely only be a relevant solution for v2.2 or probably later.
(Reporter)

Updated

3 years ago
Summary: [FFOS7715 v2.1]Alarm which is repeat everyday cannot work after changing system time to an earlier one → [FFOS7715 v2.1] [Clock] Alarm which is repeat everyday cannot work after changing system time to an earlier one
Duplicate of this bug: 1100726

Comment 11

3 years ago
Whether the firefox os  provides the following mechanism:

1.A application isn't running,
2.The application can receive a broadcast.
3.the broadcast is registered on manifest.webapp.

It likes the broadcast of android os ?


 Best Regards,
System messages (an internal thing) can wake up apps.  mozAlarms uses this mechanism, as does the simple push API https://developer.mozilla.org/en-US/docs/Web/API/Simple_Push_API that allows servers to deliver notifications to devices in an efficient fashion and wake registered apps.  It's a particularly ugly and not necessary reliable mechanism to try and address this problem.

Comment 13

3 years ago
Hi Vance Chen:

 The issue has as been as a PTR Block, can you provider a deadline for it?

thanks 
duzc.
Flags: needinfo?(vchen)
(In reply to ffos_st from comment #13)
> Hi Vance Chen:
> 
>  The issue has as been as a PTR Block, can you provider a deadline for it?
> 
> thanks 
> duzc.

Hi Duzc.

As mentioned by Andrew and Sherman, since our API design doesn't take this kind scenario into consideration, for now we don't have a solid way to solve this issue. All we can do is workaround solution, which means you are on your own for this one. All Mozilla can do is to provide suggestions. Sorry about that.

Hi Chens -

I know it is far fetch, but just for the sake of discussion, is it possible the partner can solve this problem by updating the Alarm database inside some apps that will guarantee to handle the timechanged event ?
Flags: needinfo?(vchen) → needinfo?(shchen)
It's possible but could introduce some overhead and should be carefully considered before taking this.

attachment 8542054 [details] [diff] [review] can do the trick to update alarm, but it works only if clock app is running. So maybe one thing you can do is to launch clock app when time changes, this patch[1] could help to launch clock app and you can combine with attachment 8542054 [details] [diff] [review] to achieve launch clock app and update alarm. 

Again, this is really not a good solution, it will launch clock app every time when user changed system time, you should carefully evaluate before you take this onto some low-end devices.

[1]: https://github.com/shamenchens/gaia/commit/6bd39553dcc5ec6a600480e50f0923fa88e6eab2
Flags: needinfo?(shchen)
Chens, appreciate your help. 

Hi Duzc -

Could you based on Chens's feedback on Comment#15 to create a patch that do the following 2 things?

1. Launch clock app whenever system time is changed.
2. Update the alarm database after you launch the clock app.

Also as Chens pointed out, this is tricky and not a good solution. You should do this only if your QA consider this issue a blocker.
Flags: needinfo?(ffos_st)

Comment 17

3 years ago
HI Vance Chen

->1. Launch clock app whenever system time is changed.
->2. Update the alarm database after you launch the clock app.
It isn't good idea.
 when system time is changed, the calendar app also has the same issue.
 Launch clock app can not solve the issue.

Best Regards,
duzc
Flags: needinfo?(ffos_st) → needinfo?(vchen)
(In reply to ffos_st from comment #17)
> HI Vance Chen
> 
> ->1. Launch clock app whenever system time is changed.
> ->2. Update the alarm database after you launch the clock app.
> It isn't good idea.
>  when system time is changed, the calendar app also has the same issue.
>  Launch clock app can not solve the issue.
> 
> Best Regards,
> duzc

Yes as mentioned, right now we just don't have a perfect solution to solve this kind of problem. The best way is to get it fixed systematically on 2.2, As to 2.1, I think the best we can do is just fix it case by case. If you have better suggestion, Mozilla is willing to discuss with you
Flags: needinfo?(vchen) → needinfo?(ffos_st)

Updated

3 years ago
Blocks: 1123554
Whiteboard: sprd380876 → sprd380876, PTR1_BLOCK

Comment 19

3 months ago
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.