Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 5792b00

Browse files
author
Shane Tomlinson
committed
fix(sync): Remove support for context=fx_desktop_v2
Hot on the heels of #6895, it's now relatively pain free to deprecate a context. This deprecates `context=fx_desktop_v2` which hasn't been used since Firefox 45, 20 versions ago. Users will instead be prompted to upgrade their Firefox. fixes #7030
1 parent 867e865 commit 5792b00

File tree

16 files changed

+117
-591
lines changed

16 files changed

+117
-591
lines changed

app/scripts/lib/app-start.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,8 @@ Start.prototype = {
316316
initializeAuthenticationBroker () {
317317
if (! this._authenticationBroker) {
318318
let context;
319-
if (this._isFxDesktopV2()) {
320-
if (this._isIframeContext()) {
321-
context = Constants.FX_FIRSTRUN_V1_CONTEXT;
322-
} else {
323-
context = Constants.FX_DESKTOP_V2_CONTEXT;
324-
}
319+
if (this._isIframeContext() && this._isServiceSync()) {
320+
context = Constants.FX_FIRSTRUN_V1_CONTEXT;
325321
} else if (this._isOAuth()) {
326322
context = this._chooseOAuthBrokerContext();
327323
} else {
@@ -663,16 +659,6 @@ Start.prototype = {
663659
return !! (service && compareToService && service === compareToService);
664660
},
665661

666-
_isFxDesktopV2 () {
667-
// A user is signing into sync from within an iframe on a trusted
668-
// web page. Automatically speak version 2 using WebChannels.
669-
//
670-
// A check for context=fx_desktop_v2 can be added when about:accounts
671-
// is converted to use WebChannels.
672-
return (this._isServiceSync() && this._isIframeContext()) ||
673-
(this._isContext(Constants.FX_DESKTOP_V2_CONTEXT));
674-
},
675-
676662
_isContext (contextName) {
677663
return this._getContext() === contextName;
678664
},

app/scripts/models/auth_brokers/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ const AUTH_BROKERS = [
1616
context: Constants.FX_SYNC_CONTEXT,
1717
Constructor: require('../auth_brokers/fx-sync')
1818
},
19-
{
20-
context: Constants.FX_DESKTOP_V2_CONTEXT,
21-
Constructor: require('../auth_brokers/fx-desktop-v2')
22-
},
2319
{
2420
context: Constants.FX_DESKTOP_V3_CONTEXT,
2521
Constructor: require('../auth_brokers/fx-desktop-v3')

app/tests/spec/lib/app-start.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ define(function (require, exports, module) {
1010
const BaseBroker = require('models/auth_brokers/base');
1111
const Constants = require('lib/constants');
1212
const ErrorUtils = require('lib/error-utils');
13-
const FxDesktopV2Broker = require('models/auth_brokers/fx-desktop-v2');
1413
const FxFennecV1Broker = require('models/auth_brokers/fx-fennec-v1');
1514
const FxFirstrunV1Broker = require('models/auth_brokers/fx-firstrun-v1');
1615
const FxFirstrunV2Broker = require('models/auth_brokers/fx-firstrun-v2');
@@ -324,16 +323,6 @@ define(function (require, exports, module) {
324323
});
325324
});
326325

327-
describe('fx-desktop-v2', () => {
328-
it('returns an FxDesktopV2 broker if `context=fx_desktop_v2`', () => {
329-
windowMock.location.search = Url.objToSearchString({
330-
context: Constants.FX_DESKTOP_V2_CONTEXT
331-
});
332-
333-
return testExpectedBrokerCreated(FxDesktopV2Broker);
334-
});
335-
});
336-
337326
describe('fx-fennec-v1', () => {
338327
it('returns an FxFennecV1 broker if `context=fx_fennec_v1`', () => {
339328
windowMock.location.search = Url.objToSearchString({

app/tests/spec/models/auth_brokers/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ describe('models/auth_brokers/index', () => {
2525
assert.ok(VALID_TYPE.test(authBroker.prototype.type));
2626
});
2727

28-
it('get returns correct broker for desktop-v2 context', () => {
29-
const authBroker = index.get(constants.FX_DESKTOP_V2_CONTEXT);
30-
assert.equal(authBroker, require('models/auth_brokers/fx-desktop-v2'));
31-
assert.ok(VALID_TYPE.test(authBroker.prototype.type));
32-
});
33-
3428
it('get returns correct broker for desktop-v3 context', () => {
3529
const authBroker = index.get(constants.FX_DESKTOP_V3_CONTEXT);
3630
assert.equal(authBroker, require('models/auth_brokers/fx-desktop-v3'));

app/tests/spec/models/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ define(function (require, exports, module) {
862862
email: 'testuser@testuser.com',
863863
keyFetchToken: 'old-key-fetch-token',
864864
sessionToken: 'old-session-token',
865-
sessionTokenContext: 'fx_desktop_v2',
865+
sessionTokenContext: 'fx_desktop_v3',
866866
uid,
867867
unwrapBKey: 'old-unwrap-b-key',
868868
});

app/tests/spec/models/verification/same-browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ define(function (require, exports, module) {
126126

127127
it('password reset, stores and loads verification keyed by email (pre-train-117)', function () {
128128
const persistModel = new SameBrowserVerificationModel({
129-
context: 'fx_desktop_v2'
129+
context: 'fx_desktop_v3'
130130
}, {
131131
email: 'testuser@testuser.com',
132132
namespace: 'context',
@@ -143,7 +143,7 @@ define(function (require, exports, module) {
143143
});
144144

145145
loadModel.load();
146-
assert.equal(loadModel.get('context'), 'fx_desktop_v2');
146+
assert.equal(loadModel.get('context'), 'fx_desktop_v3');
147147
});
148148

149149
it('password reset, stores and loads verification keyed by email, both uid and email specified in load (>= train-117)', function () {

server/lib/routes/get-index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ module.exports = function (config) {
4747
}));
4848

4949
const NO_LONGER_SUPPORTED_CONTEXTS = new Set([
50-
'fx_desktop_v1'
50+
'fx_desktop_v1',
51+
'fx_desktop_v2'
5152
]);
5253

5354
return {

tests/functional.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ module.exports = [
1414
'tests/functional/sign_in_totp.js',
1515
'tests/functional/sign_in_recovery_code.js',
1616
'tests/functional/sync_v1.js',
17+
'tests/functional/sync_v2.js',
1718
'tests/functional/sign_up.js',
1819
'tests/functional/complete_sign_in.js',
1920
'tests/functional/complete_sign_up.js',
2021
'tests/functional/connect_another_device.js',
2122
'tests/functional/send_sms.js',
22-
'tests/functional/sync_v2_sign_up.js',
23-
'tests/functional/sync_v2_sign_in.js',
24-
'tests/functional/sync_v2_reset_password.js',
25-
'tests/functional/sync_v2_settings.js',
26-
'tests/functional/sync_v2_force_auth.js',
2723
'tests/functional/sync_v3_force_auth.js',
2824
'tests/functional/sync_v3_reset_password.js',
2925
'tests/functional/sync_v3_settings.js',

tests/functional/confirm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ registerSuite('confirm', {
6161
},
6262

6363
'sign up with a restmail address, get the open restmail button': function () {
64-
var SIGNUP_URL = intern._config.fxaContentRoot + 'signup?context=fx_desktop_v2&service=sync';
64+
var SIGNUP_URL = intern._config.fxaContentRoot + 'signup?context=fx_desktop_v3&service=sync';
6565
this.timeout = 90000;
6666

6767
return this.remote

tests/functional/sync_v2.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
'use strict';
6+
7+
const { registerSuite } = intern.getInterface('object');
8+
const FunctionalHelpers = require('./lib/helpers');
9+
const selectors = require('./lib/selectors');
10+
const config = intern._config;
11+
12+
const FORCE_AUTH_PAGE_URL = `${config.fxaContentRoot}force_auth?context=fx_desktop_v2&service=sync`;
13+
const SIGNIN_PAGE_URL = `${config.fxaContentRoot}signin?context=fx_desktop_v2&service=sync`;
14+
const SIGNUP_PAGE_URL = `${config.fxaContentRoot}signin?context=fx_desktop_v2&service=sync`;
15+
const RESET_PASSWORD_PAGE_URL = `${config.fxaContentRoot}reset_password?context=fx_desktop_v2&service=sync`;
16+
17+
const {
18+
clearBrowserState,
19+
click,
20+
openPage,
21+
testElementExists,
22+
} = FunctionalHelpers;
23+
24+
registerSuite('Firefox Desktop Sync v2', {
25+
26+
beforeEach: function () {
27+
return this.remote
28+
.then(clearBrowserState({ force: true }));
29+
},
30+
31+
afterEach: function () {
32+
return this.remote
33+
.execute(() => {
34+
// Opening about:blank aborts the Firefox download
35+
// and prevents the tests from stalling when run on CentOS
36+
window.location.href = 'about:blank';
37+
});
38+
},
39+
40+
tests: {
41+
'force_auth': function () {
42+
return this.remote
43+
.then(openPage(FORCE_AUTH_PAGE_URL, selectors.UPDATE_FIREFOX.HEADER))
44+
.then(click(selectors.UPDATE_FIREFOX.BUTTON_DOWNLOAD_FIREFOX))
45+
46+
.then(testElementExists(selectors.DOWNLOAD_FIREFOX_THANKS.HEADER));
47+
},
48+
'signin': function () {
49+
return this.remote
50+
.then(openPage(SIGNIN_PAGE_URL, selectors.UPDATE_FIREFOX.HEADER))
51+
.then(click(selectors.UPDATE_FIREFOX.BUTTON_DOWNLOAD_FIREFOX))
52+
53+
.then(testElementExists(selectors.DOWNLOAD_FIREFOX_THANKS.HEADER));
54+
},
55+
'signup': function () {
56+
return this.remote
57+
.then(openPage(SIGNUP_PAGE_URL, selectors.UPDATE_FIREFOX.HEADER))
58+
.then(click(selectors.UPDATE_FIREFOX.BUTTON_DOWNLOAD_FIREFOX))
59+
60+
.then(testElementExists(selectors.DOWNLOAD_FIREFOX_THANKS.HEADER));
61+
},
62+
'reset_password': function () {
63+
return this.remote
64+
.then(openPage(RESET_PASSWORD_PAGE_URL, selectors.UPDATE_FIREFOX.HEADER))
65+
.then(click(selectors.UPDATE_FIREFOX.BUTTON_DOWNLOAD_FIREFOX))
66+
67+
.then(testElementExists(selectors.DOWNLOAD_FIREFOX_THANKS.HEADER));
68+
}
69+
}
70+
});

0 commit comments

Comments
 (0)