Last Comment Bug 729248 - Smarter upload of our clients record
: Smarter upload of our clients record
Product: Android Background Services
Classification: Client Software
Component: Android Sync (show other bugs)
: unspecified
: ARM Android
P2 normal
: mozilla14
Assigned To: Marina Samuel [:emtwo]
Depends on: 709347 731125
Blocks: 715796
  Show dependency treegraph
Reported: 2012-02-21 12:28 PST by Richard Newman [:rnewman]
Modified: 2013-04-04 13:48 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Richard Newman [:rnewman] 2012-02-21 12:28:29 PST
Should only upload when we're getting dangerously close to our TTL, just as desktop does.

This will involve tracking a server-side timestamp.

Whenever we upload, bump this timestamp from X-Weave-Timestamp.

Whenever we download our client record, because another client has changed it, bump this timestamp from the modified time.

Whenever we process commands, the subsequent upload of a commandless record will result in bumping the timestamp.

(And the post-command upload should have an If-Unmodified-Since header to avoid losing a command.)
Comment 1 User image Richard Newman [:rnewman] 2012-03-15 01:26:29 PDT
Comment 2 User image Richard Newman [:rnewman] 2012-03-15 01:35:38 PDT

With this change, Android Sync will no longer upload a client record on every sync. It will upload on its first sync, and every seven days thereafter, or whenever it processes a command.

(It's not currently smart enough to know when the server has been wiped, and reupload.)

The easiest way to verify this is to check desktop: when it syncs, it won't see the mobile device's client record as changed.

Sync mobile, then desktop, then mobile again.

Now when you next sync desktop, you'll see:

1331800456513	Sync.Service	DEBUG	Refreshing client list.
1331800456514	Sync.Engine.Clients	INFO	0 outgoing items pre-reconciliation
1331800456516	Sync.Engine.Clients	INFO	Records: 0 applied, 0 successfully, 0 failed to apply, 0 newly failed to apply, 0 reconciled.
Comment 3 User image Marco Bonardo [::mak] 2012-03-16 05:54:34 PDT
Comment 4 User image Mark Finkle (:mfinkle) (use needinfo?) 2012-03-24 09:15:50 PDT

Note You need to log in before you can comment on or make changes to this bug.