--- a/services/sync/tests/unit/test_bookmark_repair.js
+++ b/services/sync/tests/unit/test_bookmark_repair.js
@@ -158,34 +158,34 @@ add_task(async function test_bookmark_re
await validationPromise;
let flowID = Svc.Prefs.get("repairs.bookmarks.flowID");
checkRecordedEvents([{
object: "repair",
method: "started",
value: undefined,
extra: {
flowID,
- numIDs: "1",
+ numIDs: "2",
},
}, {
object: "sendcommand",
method: "repairRequest",
value: undefined,
extra: {
flowID,
deviceID: Service.identity.hashedDeviceID(remoteID),
},
}, {
object: "repair",
method: "request",
value: "upload",
extra: {
deviceID: Service.identity.hashedDeviceID(remoteID),
flowID,
- numIDs: "1",
+ numIDs: "2",
},
}], "Should record telemetry events for repair request");
// We should have started a repair with our second client.
equal((await clientsEngine.getClientCommands(remoteID)).length, 1,
"Should queue repair request for remote client after repair");
_("Sync to send outgoing repair request");
await Service.sync();
@@ -220,33 +220,33 @@ add_task(async function test_bookmark_re
flowID,
},
}, {
object: "repairResponse",
method: "uploading",
value: undefined,
extra: {
flowID,
- numIDs: "1",
+ numIDs: "2",
},
}, {
object: "sendcommand",
method: "repairResponse",
value: undefined,
extra: {
flowID,
deviceID: Service.identity.hashedDeviceID(initialID),
},
}, {
object: "repairResponse",
method: "finished",
value: undefined,
extra: {
flowID,
- numIDs: "1",
+ numIDs: "2",
}
}], "Should record telemetry events for repair response");
// We should queue the repair response for the initial client.
equal((await remoteClientsEngine.getClientCommands(initialID)).length, 1,
"Should queue repair response for initial client after repair");
ok(user.collection("bookmarks").wbo(bookmarkInfo.guid),
"Should upload missing bookmark");
@@ -285,17 +285,17 @@ add_task(async function test_bookmark_re
},
}, {
object: "repair",
method: "response",
value: "upload",
extra: {
flowID,
deviceID: Service.identity.hashedDeviceID(remoteID),
- numIDs: "1",
+ numIDs: "2",
},
}, {
object: "repair",
method: "finished",
value: undefined,
extra: {
flowID,
numIDs: "0",
--- a/services/sync/tests/unit/test_bookmark_repair_requestor.js
+++ b/services/sync/tests/unit/test_bookmark_repair_requestor.js
@@ -100,22 +100,22 @@ add_task(async function test_requestor_n
await requestor.startRepairs(validationInfo, flowID);
// there are no clients, so we should end up in "finished" (which we need to
// check via telemetry)
deepEqual(mockService._recordedEvents, [
{ object: "repair",
method: "started",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
},
{ object: "repair",
method: "finished",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
}
]);
});
add_task(async function test_requestor_one_client_no_response() {
let mockService = new MockService({ "client-a": makeClientRecord("client-a") });
let requestor = NewBookmarkRepairRequestor(mockService);
let validationInfo = {
@@ -151,32 +151,32 @@ add_task(async function test_requestor_o
await requestor.continueRepairs();
// There are no more clients, so we've given up.
checkRepairFinished();
deepEqual(mockService._recordedEvents, [
{ object: "repair",
method: "started",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-a" },
+ extra: { flowID, numIDs: 4, deviceID: "client-a" },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-a" },
+ extra: { flowID, numIDs: 4, deviceID: "client-a" },
},
{ object: "repair",
method: "finished",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
}
]);
});
add_task(async function test_requestor_one_client_no_sync() {
let mockService = new MockService({ "client-a": makeClientRecord("client-a") });
let requestor = NewBookmarkRepairRequestor(mockService);
let validationInfo = {
@@ -203,32 +203,32 @@ add_task(async function test_requestor_o
await requestor.continueRepairs();
// We should be finished as we gave up in disgust.
checkRepairFinished();
deepEqual(mockService._recordedEvents, [
{ object: "repair",
method: "started",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-a" },
+ extra: { flowID, numIDs: 4, deviceID: "client-a" },
},
{ object: "repair",
method: "abandon",
value: "silent",
extra: { flowID, deviceID: "client-a" },
},
{ object: "repair",
method: "finished",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
}
]);
});
add_task(async function test_requestor_latest_client_used() {
let mockService = new MockService({
"client-early": makeClientRecord("client-early", { serverLastModified: Date.now() - 10 }),
"client-late": makeClientRecord("client-late", { serverLastModified: Date.now() }),
@@ -283,47 +283,47 @@ add_task(async function test_requestor_c
checkOutgoingCommand(mockService, "client-b");
// Now let's pretend client B wrote all missing IDs.
let response = {
collection: "bookmarks",
request: "upload",
flowID: requestor._flowID,
clientID: "client-b",
- ids: ["a", "b", "c"],
+ ids: ["a", "b", "c", "x"],
}
await requestor.continueRepairs(response);
// We should be finished as we got all our IDs.
checkRepairFinished();
deepEqual(mockService._recordedEvents, [
{ object: "repair",
method: "started",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-a" },
+ extra: { flowID, numIDs: 4, deviceID: "client-a" },
},
{ object: "repair",
method: "abandon",
value: "missing",
extra: { flowID, deviceID: "client-a" },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-b" },
+ extra: { flowID, numIDs: 4, deviceID: "client-b" },
},
{ object: "repair",
method: "response",
value: "upload",
- extra: { flowID, deviceID: "client-b", numIDs: 3 },
+ extra: { flowID, deviceID: "client-b", numIDs: 4 },
},
{ object: "repair",
method: "finished",
value: undefined,
extra: { flowID, numIDs: 0 },
}
]);
});
@@ -366,47 +366,47 @@ add_task(async function test_requestor_s
checkOutgoingCommand(mockService, "client-b");
// Now let's pretend client B write the missing ID.
response = {
collection: "bookmarks",
request: "upload",
clientID: "client-b",
flowID: requestor._flowID,
- ids: ["c"],
+ ids: ["c", "x"],
}
await requestor.continueRepairs(response);
// We should be finished as we got all our IDs.
checkRepairFinished();
deepEqual(mockService._recordedEvents, [
{ object: "repair",
method: "started",
value: undefined,
- extra: { flowID, numIDs: 3 },
+ extra: { flowID, numIDs: 4 },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 3, deviceID: "client-a" },
+ extra: { flowID, numIDs: 4, deviceID: "client-a" },
},
{ object: "repair",
method: "response",
value: "upload",
extra: { flowID, deviceID: "client-a", numIDs: 2 },
},
{ object: "repair",
method: "request",
value: "upload",
- extra: { flowID, numIDs: 1, deviceID: "client-b" },
+ extra: { flowID, numIDs: 2, deviceID: "client-b" },
},
{ object: "repair",
method: "response",
value: "upload",
- extra: { flowID, deviceID: "client-b", numIDs: 1 },
+ extra: { flowID, deviceID: "client-b", numIDs: 2 },
},
{ object: "repair",
method: "finished",
value: undefined,
extra: { flowID, numIDs: 0 },
}
]);
});
@@ -491,24 +491,24 @@ add_task(async function test_requestor_a
await requestor.continueRepairs(response);
// We should have aborted now
checkRepairFinished();
const expected = [
{ method: "started",
object: "repair",
value: undefined,
- extra: { flowID, numIDs: "3" },
+ extra: { flowID, numIDs: "4" },
},
{ method: "request",
object: "repair",
value: "upload",
- extra: { flowID, numIDs: "3", deviceID: "client-a" },
+ extra: { flowID, numIDs: "4", deviceID: "client-a" },
},
{ method: "aborted",
object: "repair",
value: undefined,
- extra: { flowID, numIDs: "3", reason: "other clients repairing" },
+ extra: { flowID, numIDs: "4", reason: "other clients repairing" },
}
];
deepEqual(mockService._recordedEvents, expected);
});