Bug 1528219 - Display explicit non-backward message when trying to connect from 67 to older version r=daisuke,loganfsmyth

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-03-09 00:59:03 +00:00
Родитель 3d85755385
Коммит 6fef20e426
8 изменённых файлов: 91 добавлений и 11 удалений

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

@ -34,14 +34,21 @@ class CompatibilityWarning extends PureComponent {
return null;
}
const isTooOld = status === COMPATIBILITY_STATUS.TOO_OLD;
const localizationId = isTooOld ?
"about-debugging-runtime-version-too-old" :
"about-debugging-runtime-version-too-recent";
const statusClassName = isTooOld ?
"js-compatibility-warning-too-old" :
"js-compatibility-warning-too-recent";
let localizationId, statusClassName;
switch (status) {
case COMPATIBILITY_STATUS.TOO_OLD:
statusClassName = "js-compatibility-warning-too-old";
localizationId = "about-debugging-runtime-version-too-old";
break;
case COMPATIBILITY_STATUS.TOO_RECENT:
statusClassName = "js-compatibility-warning-too-recent";
localizationId = "about-debugging-runtime-version-too-recent";
break;
case COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER:
statusClassName = "js-compatibility-warning-too-old-67-debugger";
localizationId = "about-debugging-runtime-version-too-old-67-debugger";
break;
}
return Message(
{

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

@ -7,19 +7,23 @@ const COMPATIBLE_RUNTIME = "Compatible Runtime";
const COMPATIBLE_DEVICE = "Compatible Device";
const OLD_RUNTIME = "Old Runtime";
const OLD_DEVICE = "Old Device";
const DEBUGGER_67_RUNTIME = "Bad Runtime Debugger 67";
const DEBUGGER_67_DEVICE = "Bad Device Debugger 67";
const RECENT_RUNTIME = "Recent Runtime";
const RECENT_DEVICE = "Recent Device";
add_task(async function() {
const { COMPATIBILITY_STATUS } =
require("devtools/client/shared/remote-debugging/version-checker");
const { COMPATIBLE, TOO_OLD, TOO_RECENT } = COMPATIBILITY_STATUS;
const { COMPATIBLE, TOO_OLD, TOO_OLD_67_DEBUGGER, TOO_RECENT } = COMPATIBILITY_STATUS;
info("Create three mocked runtimes, with different compatibility reports");
info("Create several mocked runtimes, with different compatibility reports");
const mocks = new Mocks();
createRuntimeWithReport(mocks, COMPATIBLE_RUNTIME, COMPATIBLE_DEVICE, COMPATIBLE);
createRuntimeWithReport(mocks, OLD_RUNTIME, OLD_DEVICE, TOO_OLD);
createRuntimeWithReport(mocks, RECENT_RUNTIME, RECENT_DEVICE, TOO_RECENT);
createRuntimeWithReport(mocks, DEBUGGER_67_RUNTIME, DEBUGGER_67_DEVICE,
TOO_OLD_67_DEBUGGER);
const { document, tab } = await openAboutDebugging();
mocks.emitUSBUpdate();
@ -28,6 +32,7 @@ add_task(async function() {
await connectToRuntime(COMPATIBLE_DEVICE, document);
await connectToRuntime(OLD_DEVICE, document);
await connectToRuntime(RECENT_DEVICE, document);
await connectToRuntime(DEBUGGER_67_DEVICE, document);
info("Select the compatible runtime and check that no warning is displayed");
await selectRuntime(COMPATIBLE_DEVICE, COMPATIBLE_RUNTIME, document);
@ -44,6 +49,11 @@ add_task(async function() {
ok(document.querySelector(".js-compatibility-warning-too-recent"),
"Expected compatibility warning is displayed (too-recent)");
info("Select the runtime incompatible with Fx 67 " +
"and check that the debugger 67 warning is displayed");
await selectRuntime(DEBUGGER_67_DEVICE, DEBUGGER_67_RUNTIME, document);
ok(document.querySelector(".js-compatibility-warning-too-old-67-debugger"));
await removeTab(tab);
});

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

@ -141,6 +141,14 @@ about-debugging-runtime-service-workers-not-compatible = Your browser configurat
# { $minVersion } is the minimum version that is compatible with the current Firefox instance (same format)
about-debugging-runtime-version-too-old = The connected runtime has an old version ({ $runtimeVersion }). The minimum supported version is ({ $minVersion }). This is an unsupported setup and may cause DevTools to fail. Please update the connected runtime. <a>Troubleshooting</a>
# Dedicated message for a backward compatibility issue that occurs when connecting:
# - from Fx 67 to 66 or to 65
# - from Fx 68 to 66
# Those are normally in range for DevTools compatibility policy, but specific non
# backward compatible changes broke the debugger in those scenarios (Bug 1528219).
# { $runtimeVersion } is the version of the remote runtime (for instance "67.0a1")
about-debugging-runtime-version-too-old-67-debugger = The Debugger panel may not work with the connected runtime. Please use Firefox { $runtimeVersion } if you need to use the Debugger with this runtime.
# This string is displayed in the runtime page if the remote runtime version is too recent.
# "Troubleshooting" link points to https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Troubleshooting
# { $runtimeID } is the build ID of the remote runtime (for instance "20181231", format is yyyyMMdd)

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

@ -46,7 +46,6 @@ class AccessibilityStartup {
// See targe.js@getActorDescription for more information.
try {
this._walker = await this._accessibility.getWalker();
this._supports = {};
// Only works with FF61+ targets
this._supports.enableDisable =

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

@ -51,6 +51,15 @@ error_runtimeVersionTooRecent=The connected runtime has a more recent build date
# Variable: runtime app version (looks like this 52.a3) and firefox version (same format)
error_runtimeVersionTooOld=The connected runtime has an old version (%1$S). The minimum supported version is (%2$S). This is an unsupported setup and may cause DevTools to fail. Please update the connected runtime.
# LOCALIZATION NOTE (error_runtimeVersionTooOld67Debugger): Dedicated message
# for a backward compatibility issue that occurs when connecting:
# - from Fx 67 to 66 or to 65
# - from Fx 68 to 66
# Those are normally in range for DevTools compatibility policy, but specific non
# backward compatible changes broke the debugger in those scenarios (Bug 1528219).
# Variable: runtime app version (looks like this 52.a3)
error_runtimeVersionTooOld67Debugger=The Debugger panel may not work with the connected runtime. Please use Firefox %S if you need to use the Debugger with this runtime.
addons_stable=stable
addons_unstable=unstable
addons_install_button=install

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

@ -81,6 +81,46 @@ const TEST_DATA = [
runtimeVersion: "60.0",
expected: COMPATIBILITY_STATUS.TOO_RECENT,
},
{
description: "debugger backward compatibility issue for 67 -> 66",
localBuildId: "20190131000000",
localVersion: "67.0",
runtimeBuildId: "20190131000000",
runtimeVersion: "66.0",
expected: COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER,
},
{
description: "debugger backward compatibility issue for 67 -> 65",
localBuildId: "20190131000000",
localVersion: "67.0",
runtimeBuildId: "20190131000000",
runtimeVersion: "65.0",
expected: COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER,
},
{
description: "debugger backward compatibility issue for 68 -> 66",
localBuildId: "20190131000000",
localVersion: "68.0",
runtimeBuildId: "20190131000000",
runtimeVersion: "66.0",
expected: COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER,
},
{
description: "regular compatibility issue for 67 -> 64 (not debugger-related)",
localBuildId: "20190131000000",
localVersion: "67.0",
runtimeBuildId: "20190131000000",
runtimeVersion: "64.0",
expected: COMPATIBILITY_STATUS.TOO_OLD,
},
{
description: "debugger backward compatibility error not raised for 68 -> 67",
localBuildId: "20190131000000",
localVersion: "68.0",
runtimeBuildId: "20190202000000",
runtimeVersion: "67.0",
expected: COMPATIBILITY_STATUS.COMPATIBLE,
},
];
add_task(async function testVersionChecker() {

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

@ -12,6 +12,7 @@ const MS_PER_DAY = 1000 * 60 * 60 * 24;
const COMPATIBILITY_STATUS = {
COMPATIBLE: "compatible",
TOO_OLD: "too-old",
TOO_OLD_67_DEBUGGER: "too-old-67-debugger",
TOO_RECENT: "too-recent",
};
exports.COMPATIBILITY_STATUS = COMPATIBILITY_STATUS;
@ -131,6 +132,8 @@ function _compareVersionCompatibility(localDescription, deviceDescription) {
// Still allow devices to be newer by up to a week. This accommodates those with local
// device builds, since their devices will almost always be newer than the client.
status = COMPATIBILITY_STATUS.TOO_RECENT;
} else if (localMajorVersion >= 67 && runtimeMajorVersion < 67) {
status = COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER;
} else {
status = COMPATIBILITY_STATUS.COMPATIBLE;
}

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

@ -751,6 +751,10 @@ var UI = {
this.reportError("error_runtimeVersionTooOld", report.runtimeVersion,
report.minVersion);
}
if (report.status == COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER) {
this.reportError("error_runtimeVersionTooOld67Debugger",
report.runtimeVersion);
}
}
},