Bug 1534837 - Invalidate the debugger pref schema. r=jlast

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Logan Smyth 2019-03-13 18:57:18 +00:00
Родитель e4b13f1adb
Коммит 9f89c9dddd
2 изменённых файлов: 13 добавлений и 9 удалений

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

@ -7,7 +7,7 @@
import * as firefox from "./firefox";
import * as chrome from "./chrome";
import { prefs, asyncStore } from "../utils/prefs";
import { prefs, asyncStore, verifyPrefSchema } from "../utils/prefs";
import { setupHelper } from "../utils/dbg";
import {
@ -77,6 +77,8 @@ export async function onConnect(
return;
}
verifyPrefSchema();
const client = getClient(connection);
const commands = client.clientCommands;

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

@ -5,11 +5,11 @@
// @flow
import { PrefsHelper } from "devtools-modules";
import { isDevelopment, isTesting } from "devtools-environment";
import { isDevelopment } from "devtools-environment";
import Services from "devtools-services";
import { asyncStoreHelper } from "./asyncStoreHelper";
const prefsSchemaVersion = "1.0.8";
const prefsSchemaVersion = "1.0.9";
const pref = Services.pref;
if (isDevelopment()) {
@ -132,10 +132,12 @@ export const asyncStore = asyncStoreHelper("debugger", {
eventListenerBreakpoints: ["event-listener-breakpoints", []]
});
if (!isTesting && prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
// clear pending Breakpoints
asyncStore.pendingBreakpoints = {};
asyncStore.tabs = [];
asyncStore.xhrBreakpoints = [];
prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion;
export function verifyPrefSchema() {
if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
// clear pending Breakpoints
asyncStore.pendingBreakpoints = {};
asyncStore.tabs = [];
asyncStore.xhrBreakpoints = [];
prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion;
}
}