mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 07:24:47 +00:00
Backed out changeset 6e7d21f9e8ef (bug 1598562) causing bug 1600450 in 72 beta
--HG-- extra : rebase_source : eb7b34c8d7259529189837a2a51dec53263c7cef
This commit is contained in:
parent
60cb3396f1
commit
b6af88ada4
@ -60,6 +60,11 @@ const DB_NAME = "remote-settings";
|
||||
const TELEMETRY_COMPONENT = "remotesettings";
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "console", () => Utils.log);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gServerURL",
|
||||
"services.settings.server"
|
||||
);
|
||||
|
||||
/**
|
||||
* cacheProxy returns an object Proxy that will memoize properties of the target.
|
||||
@ -272,7 +277,7 @@ class RemoteSettingsClient extends EventEmitter {
|
||||
}
|
||||
|
||||
httpClient() {
|
||||
const api = new KintoHttpClient(Utils.SERVER_URL);
|
||||
const api = new KintoHttpClient(gServerURL);
|
||||
return api.bucket(this.bucketName).collection(this.collectionName);
|
||||
}
|
||||
|
||||
@ -393,7 +398,7 @@ class RemoteSettingsClient extends EventEmitter {
|
||||
async sync(options) {
|
||||
// We want to know which timestamp we are expected to obtain in order to leverage
|
||||
// cache busting. We don't provide ETag because we don't want a 304.
|
||||
const { changes } = await Utils.fetchLatestChanges(Utils.SERVER_URL, {
|
||||
const { changes } = await Utils.fetchLatestChanges(gServerURL, {
|
||||
filters: {
|
||||
collection: this.collectionName,
|
||||
bucket: this.bucketName,
|
||||
@ -542,7 +547,7 @@ class RemoteSettingsClient extends EventEmitter {
|
||||
// Fetch changes from server, and make sure we overwrite local data.
|
||||
const strategy = Kinto.syncStrategy.PULL_ONLY;
|
||||
syncResult = await kintoCollection.sync({
|
||||
remote: Utils.SERVER_URL,
|
||||
remote: gServerURL,
|
||||
strategy,
|
||||
expectedTimestamp,
|
||||
});
|
||||
|
@ -8,11 +8,6 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { XPCOMUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/XPCOMUtils.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
|
||||
|
||||
@ -30,19 +25,7 @@ XPCOMUtils.defineLazyGetter(this, "log", () => {
|
||||
});
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gServerURL",
|
||||
"services.settings.server"
|
||||
);
|
||||
|
||||
var Utils = {
|
||||
get SERVER_URL() {
|
||||
return AppConstants.RELEASE_OR_BETA && !Cu.isInAutomation
|
||||
? "https://firefox.settings.services.mozilla.com/v1"
|
||||
: gServerURL;
|
||||
},
|
||||
|
||||
CHANGES_PATH: "/buckets/monitor/collections/changes/records",
|
||||
|
||||
/**
|
||||
|
@ -47,6 +47,7 @@ XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
|
||||
|
||||
const PREF_SETTINGS_DEFAULT_BUCKET = "services.settings.default_bucket";
|
||||
const PREF_SETTINGS_BRANCH = "services.settings.";
|
||||
const PREF_SETTINGS_SERVER = "server";
|
||||
const PREF_SETTINGS_DEFAULT_SIGNER = "default_signer";
|
||||
const PREF_SETTINGS_SERVER_BACKOFF = "server.backoff";
|
||||
const PREF_SETTINGS_LAST_UPDATE = "last_update_seconds";
|
||||
@ -69,6 +70,11 @@ XPCOMUtils.defineLazyGetter(this, "gPrefs", () => {
|
||||
return Services.prefs.getBranch(PREF_SETTINGS_BRANCH);
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(this, "console", () => Utils.log);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gServerURL",
|
||||
PREF_SETTINGS_BRANCH + PREF_SETTINGS_SERVER
|
||||
);
|
||||
|
||||
/**
|
||||
* Default entry filtering function, in charge of excluding remote settings entries
|
||||
@ -222,7 +228,7 @@ function remoteSettingsFunction() {
|
||||
|
||||
let pollResult;
|
||||
try {
|
||||
pollResult = await Utils.fetchLatestChanges(Utils.SERVER_URL, {
|
||||
pollResult = await Utils.fetchLatestChanges(gServerURL, {
|
||||
expectedTimestamp,
|
||||
lastEtag,
|
||||
});
|
||||
@ -369,7 +375,7 @@ function remoteSettingsFunction() {
|
||||
const {
|
||||
changes,
|
||||
currentEtag: serverTimestamp,
|
||||
} = await Utils.fetchLatestChanges(Utils.SERVER_URL);
|
||||
} = await Utils.fetchLatestChanges(gServerURL);
|
||||
|
||||
const collections = await Promise.all(
|
||||
changes.map(async change => {
|
||||
@ -396,8 +402,8 @@ function remoteSettingsFunction() {
|
||||
);
|
||||
|
||||
return {
|
||||
serverURL: Utils.SERVER_URL,
|
||||
pollingEndpoint: Utils.SERVER_URL + Utils.CHANGES_PATH,
|
||||
serverURL: gServerURL,
|
||||
pollingEndpoint: gServerURL + Utils.CHANGES_PATH,
|
||||
serverTimestamp,
|
||||
localTimestamp: gPrefs.getCharPref(PREF_SETTINGS_LAST_ETAG, null),
|
||||
lastCheck: gPrefs.getIntPref(PREF_SETTINGS_LAST_UPDATE, 0),
|
||||
|
Loading…
x
Reference in New Issue
Block a user