Bug 1558812 - Upgrade kinto-offline-client to 12.4.3 r=glasserc

Differential Revision: https://phabricator.services.mozilla.com/D34715

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mathieu Leplatre 2019-06-12 14:20:59 +00:00
Родитель 9889f42596
Коммит 94be713565
2 изменённых файлов: 61 добавлений и 6 удалений

Просмотреть файл

@ -33,7 +33,7 @@ const global = this;
var EXPORTED_SYMBOLS = ["Kinto"];
/*
* Version 12.4.2 - 87e72a0
* Version 12.4.3 - 50de713
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Kinto = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
@ -3084,7 +3084,7 @@ class CollectionTransaction {
// If status is deleted, mark as updated.
const isIdentical = oldRecord && recordsEqual(oldRecord, updated, this.localFields);
const isIdentical = oldRecord && recordsEqual(oldRecord, updated, this.collection.localFields);
const keepSynced = isIdentical && oldRecord._status == "synced";
const neverSynced = !oldRecord || oldRecord && oldRecord._status == "created";
const newStatus = keepSynced || synced ? "synced" : neverSynced ? "created" : "updated";

Просмотреть файл

@ -59,6 +59,8 @@ function run_test() {
server.registerPathHandler("/v1/buckets/main/collections/password-fields/records", handleResponse);
server.registerPathHandler("/v1/buckets/main/collections/language-dictionaries", handleResponse);
server.registerPathHandler("/v1/buckets/main/collections/language-dictionaries/records", handleResponse);
server.registerPathHandler("/v1/buckets/main/collections/with-local-fields", handleResponse);
server.registerPathHandler("/v1/buckets/main/collections/with-local-fields/records", handleResponse);
server.registerPathHandler("/fake-x5u", handleResponse);
run_next_test();
@ -101,13 +103,14 @@ add_task(async function test_records_from_dump_are_listed_as_created_in_event()
add_task(clear_state);
add_task(async function test_records_can_have_local_fields() {
const c = RemoteSettings("password-fields", { localFields: ["accepted"] });
const c = RemoteSettings("with-local-fields", { localFields: [ "accepted" ]});
c.verifySignature = false;
await c.maybeSync(2000);
const col = await c.openCollection();
await col.update({ id: "9d500963-d80e-3a91-6e74-66f3811b99cc", accepted: true });
await c.maybeSync(2000); // Does not fail.
await col.update({ id: "c74279ce-fb0a-42a6-ae11-386b567a6119", accepted: true });
await c.maybeSync(3000); // Does not fail.
});
add_task(clear_state);
@ -877,6 +880,58 @@ wNuvFqc=
}],
},
},
"GET:/v1/buckets/main/collections/with-local-fields": {
"sampleHeaders": [
"Access-Control-Allow-Origin: *",
"Access-Control-Expose-Headers: Retry-After, Content-Length, Alert, Backoff",
"Content-Type: application/json; charset=UTF-8",
"Server: waitress",
"Etag: \"1234\"",
],
"status": { status: 200, statusText: "OK" },
"responseBody": JSON.stringify({
"data": {
"id": "with-local-fields",
"last_modified": 1234,
"signature": {
"signature": "xyz",
"x5u": `http://localhost:${port}/fake-x5u`,
},
},
}),
},
"GET:/v1/buckets/main/collections/with-local-fields/records?_expected=2000&_sort=-last_modified": {
"sampleHeaders": [
"Access-Control-Allow-Origin: *",
"Access-Control-Expose-Headers: Retry-After, Content-Length, Alert, Backoff",
"Content-Type: application/json; charset=UTF-8",
"Server: waitress",
"Etag: \"2000\"",
],
"status": { status: 200, statusText: "OK" },
"responseBody": {
"data": [{
"id": "c74279ce-fb0a-42a6-ae11-386b567a6119",
"last_modified": 2000,
}],
},
},
"GET:/v1/buckets/main/collections/with-local-fields/records?_expected=3000&_sort=-last_modified&_since=2000": {
"sampleHeaders": [
"Access-Control-Allow-Origin: *",
"Access-Control-Expose-Headers: Retry-After, Content-Length, Alert, Backoff",
"Content-Type: application/json; charset=UTF-8",
"Server: waitress",
"Etag: \"3000\"",
],
"status": { status: 200, statusText: "OK" },
"responseBody": {
"data": [{
"id": "1f5c98b9-6d93-4c13-aa26-978b38695096",
"last_modified": 3000,
}],
},
},
"GET:/v1/buckets/monitor/collections/changes/records?collection=no-mocked-responses&bucket=main": {
"sampleHeaders": [
"Access-Control-Allow-Origin: *",