Closed Bug 958900 Opened 11 years ago Closed 11 years ago

Schedule a periodic sync for new FxAccountSyncAdapter

Categories

(Firefox for Android Graveyard :: Android Sync, defect)

All
Android
defect
Not set
normal

Tracking

(firefox29 fixed, firefox30 fixed, fennec29+)

RESOLVED FIXED
Firefox 30
Tracking Status
firefox29 --- fixed
firefox30 --- fixed
fennec 29+ ---

People

(Reporter: nalexander, Assigned: rnewman)

References

Details

(Whiteboard: [qa+])

Attachments

(2 files)

Related to Bug 726055 but not tracked there yet. We should add a periodic sync, contingent upon your Firefox Account state: * if your account is invalid or needs updated credentials, never; * if your account is waiting to be verified, aggressively (we want to drive conversions, and react to verification ASAP); * if your account is syncing and you're the only device, infrequently; * if your account is syncing and you're part of a a constellation of devices, frequently; * if your account is in an error state, very infrequently. http://developer.android.com/reference/android/content/ContentResolver.html#addPeriodicSync%28android.accounts.Account,%20java.lang.String,%20android.os.Bundle,%20long%29
Intuition suggests that the periodic syncing interface isn't designed for very short intervals, as we'd want for the verification waiting period, so perhaps we'd be better off with a small alarm-driven service for that? Would allow for more persistent state, too. Also need to make sure that an interruption in verification -- e.g., a user who wanders off, doesn't have that email account set up on their phone yet, etc. -- doesn't result in killing their battery. Needs an exponential backoff, I imagine, and adjusting to match the network state. And a final note: for the routine state of affairs (3 and 4), we need to make sure that the internal rate limiting is adjusted to match (or replaced by an Android-native equivalent). No sense having the system trigger syncs more frequently than we're set up to allow.
Whiteboard: [qa+]
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attached file First steps.
Early feedback, please.
Attachment #8371205 - Flags: feedback?(nalexander)
This pull req covers tracking and checking backoff for an abstract "scheduling" concept, the token server, and the current storage server. It wires in a BackoffHandler into the normal spot to handle GlobalSession backoff notices, and also tracks token failures. This also schedules periodic syncs to match the number of clients and backoff notices. Needs tests (and testing), but it's getting there.
Depends on: 969227
rnewman: this is reviewed but not landed, right?
Attachment #8371205 - Flags: feedback?(nalexander) → review+
(In reply to Nick Alexander :nalexander from comment #4) > rnewman: this is reviewed but not landed, right? Correct. James and I are planning a QA session this morning to exercise all of the backoff cases. I put together a test plan: https://etherpad.mozilla.org/fxa-sync-backoff-test-plan and addressed all of the success cases already, so we're just in error-handling land now.
Depends on: 972613
Attached patch Final patch.Splinter Review
Carrying forward review, even though I fixed some things after today's marathon QA session.
Attachment #8376016 - Flags: review+
tracking-fennec: --- → 29+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Comment on attachment 8376016 [details] [diff] [review] Final patch. [Approval Request Comment] Bug caused by (feature/regressing bug #): FxA Sync. User impact if declined: Testing completed (on m-c, etc.): m-c and QAed. Risk to taking this patch (and alternatives if risky): String or IDL/UUID changes made by this patch:
Attachment #8376016 - Flags: approval-mozilla-aurora?
Attachment #8376016 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: