Closed Bug 956936 Opened 6 years ago Closed 6 years ago

Include supported Sync protocol versions in desktop client records

Categories

(Firefox :: Sync, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29
Tracking Status
firefox27 --- fixed
firefox28 --- fixed
firefox29 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [qa+][see comment 8 for verification])

Attachments

(1 file)

No description provided.
We'll add 1.5 (or whatever) at the point it begins working!
Attachment #8356448 - Flags: review?(gps)
Please land in s-c if this is good, Greg. I'm on PTO this week.
Attachment #8356448 - Flags: review?(gps) → review+
https://hg.mozilla.org/services/services-central/rev/c0f3aea29684
Flags: in-testsuite+
Whiteboard: [qa+] → [qa+][fixed-in-services]
Comment on attachment 8356448 [details] [diff] [review]
Include supported Sync protocol versions in desktop client records. v1

**Bulk approval request for this bug and for Bug 956442, Bug 956443, Bug 956935. They all go together.**

These tiny bugs include the current Firefox version and Sync protocol version in the client records that Sync uploads. We'll use those versions to inform the decision of when to suggest a user upgrades to Firefox Account.

For the sake of completeness, I'd like for this to go as far up as possible -- including 27, if I can. This will give clients more data about how outdated other devices are, and will also make uplifting future FxA-related patches easier.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
  New work.
User impact if declined: 
  None.
Testing completed (on m-c, etc.): 
  Baking on s-c.
Risk to taking this patch (and alternatives if risky): 
  Effectively zero.
String or IDL/UUID changes made by this patch:
  None.
Attachment #8356448 - Flags: approval-mozilla-beta?
Attachment #8356448 - Flags: approval-mozilla-aurora?
Android counterpart: Bug 956935.
Blocks: 695134
Comment on attachment 8356448 [details] [diff] [review]
Include supported Sync protocol versions in desktop client records. v1

Approving the new work, given it is low risk and there is an option to backout if we see fallouts in the next beta.

:rnewman, can you add testcases or make sure to verify that the patch works and does not break anything unexpectedly ? Please feel free to seek QA help by adding verifyme and NI(:tracy) if needed.
Attachment #8356448 - Flags: approval-mozilla-beta?
Attachment #8356448 - Flags: approval-mozilla-beta+
Attachment #8356448 - Flags: approval-mozilla-aurora?
Attachment #8356448 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/c0f3aea29684
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [qa+][fixed-in-services] → [qa+]
Target Milestone: --- → mozilla29
Steps to verify:

1. Set up Sync. Allow a sync to occur.
2. Evaluate the following in a Browser Console. This will fetch our record from the server and print it, so this verifies the real uploaded data.

//=============================================================
Cu.import("resource://services-sync/main.js");
Cu.import("resource://services-sync/record.js");
Cu.import("resource://services-sync/resource.js");

let service = Weave.Service;
let engine = service.clientsEngine;
let collection = "clients";
let coll = new Collection(service.storageURL + collection, engine._recordObj, service);
let id = engine.localID;

coll.full = true;
coll.ids = [id];
let ours;
coll.recordHandler = function(item) {
  item.collection = collection;
  item.decrypt(service.collectionKeys.keyForCollection(collection));
  ours = item.cleartext;
};

coll.get();

console.log("Version: " + ours.version);
console.log("Protocols: " + JSON.stringify(ours.protocols));
//=============================================================


3. Observe that appropriate values are logged:

GET https://phx-sync123.services.mozilla.com/1.1/abcdefabcdefabcdefabcdefabcdefab/storage/clients [HTTP/1.1 200 OK 260ms]
"Version: 29.0a1"
"Protocols: ["1.1"]"

4. Now, to verify the Android half. Pair an Android device and give it a few seconds to sync. Then sync on the desktop, and run this in the same browser console:

//=====================
JSON.stringify(Weave.Service.clientsEngine._store._remoteClients);
//=====================

5. This will print one record per remote client:

"{"4cae4GAMdysY":{"id":"4cae4GAMdysY","type":"mobile","protocols":["1.1"],"version":"29.0a1","name":"Fennec rnewman on HTC One"}}

Make sure you see the protocols and the version string.
https://hg.mozilla.org/releases/mozilla-aurora/rev/1877df1a3dc4
Whiteboard: [qa+] → [qa+][see comment 8 for verification]
Blocks: 968436
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.