Closed Bug 995827 Opened 10 years ago Closed 10 years ago

Setting up a Google calendar account purges periodic sync alarms from mozAlarms

Categories

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

x86
Linux
defect
Not set
normal

Tracking

(blocking-b2g:1.3+)

VERIFIED DUPLICATE of bug 996384
1.4 S6 (25apr)
blocking-b2g 1.3+

People

(Reporter: gaye, Assigned: gaye)

Details

(Whiteboard: [p=5])

Attachments

(1 file)

When we launch calendar, we put an alarm in mozAlarms. When that alarm fires, we do a periodic sync and add another alarm to mozAlarms (to continue periodic syncing). For some reason, setting up a Google account removes the periodic sync alarms from the mozAlarms database which makes it seem like periodic syncing calendar accounts is broken. In reality,

(1) this is a Google-only issue and
(2) users can resume periodic sync by changing the sync interval which will add another entry to the mozAlarms database
Blocks: 989081
Assignee: nobody → gaye
The authorial intent behind calling clearBrowserData() before launching the browser for oauth was to clear the "child" browser's cookies before sending the user to the oauth provider. Unfortunately, WebappsApplication#clearBrowserData does more than just clear the cookies. It also purges the alarms we've scheduled via the alarms api which breaks periodic sync. Perhaps we need a more granular api in order to clear the cookies (which will enable a fresh auth interaction) without clearing the alarms.

I've added a patch (in the meantime) that doesn't make a call to clearBrowserData(). This is not necessarily a good thing. This will probably complicate (if not break) the scenario where a user has multiple Google accounts though I have not yet tested. However, this does fix the periodic sync issue.
Attachment #8405939 - Flags: feedback?(mmedeiros)
Attachment #8405939 - Flags: feedback?(jlal)
Pinging fabrice and bent regarding WebappsApplication#clearBrowserData. In my use case, I would like to clear the cookies in the "child" browser my app launches without clearing the alarms I've scheduled via the alarm manager. Can we make that happen? If so, can we do it for 1.3?
Flags: needinfo?(fabrice)
Flags: needinfo?(bent.mozilla)
blocking-b2g: --- → 1.3?
^^ Blocking a 1.3 blocker
one thing I suggested on IRC as a temporary hack is to store the current alarms and than restore them later.. but that will surely increase code complexity and can cause new bugs (race conditions, alarm might trigger during the account setup, app might crash/close during process, ...) - so I agree with :gaye that best solution would be if the system allowed some way to just clean the cookies.
Yes, I think that's a bug in several observers of webapps-clear-data. They should honor the browserOnly flag that is set to true at https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#3927 but they don't (see https://mxr.mozilla.org/mozilla-central/source/dom/alarm/AlarmService.jsm#510 for the alarms case). We set it to false when uninstalling an app to make sure we cleanup everything.

Ben, do you agree?
Flags: needinfo?(fabrice)
Whiteboard: [p=8]
Target Milestone: --- → 1.4 S5 (11apr)
Whiteboard: [p=8] → [p=5]
(In reply to Fabrice Desré [:fabrice] from comment #5)
> Ben, do you agree?

Sounds right to me
Flags: needinfo?(bent.mozilla)
So then is someone available to fix this for 1.3?
blocking-b2g: 1.3? → 1.3+
Depends on: 996384
Target Milestone: 1.4 S5 (11apr) → 1.4 S6 (25apr)
Comment on attachment 8405939 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18265

lets avoid hacks and wait for the system fix!
Attachment #8405939 - Flags: feedback?(mmedeiros)
Attachment #8405939 - Flags: feedback?(jlal)
Attachment #8405939 - Flags: feedback-
Gareth - Is this fixed with the landing of bug 996384?
Flags: needinfo?(gaye)
(In reply to Jason Smith [:jsmith] from comment #9)
> Gareth - Is this fixed with the landing of bug 996384?

We need to test & confirm but yes it should be (and bug 989081 too).
Flags: needinfo?(gaye)
(In reply to Dylan Oliver [:doliver] (PTO until 23 April) from comment #10)
> (In reply to Jason Smith [:jsmith] from comment #9)
> > Gareth - Is this fixed with the landing of bug 996384?
> 
> We need to test & confirm but yes it should be (and bug 989081 too).

ok - I'll flag bug 989081 to have someone retest
Keywords: qawanted
No longer blocks: 989081
Status: NEW → RESOLVED
Closed: 10 years ago
No longer depends on: 996384
Resolution: --- → DUPLICATE
Keywords: qawanted
bug 996384 has been fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: