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

Commit

Permalink
fix(unblock): Remove 'context' check from unblock feature-flag.
Browse files Browse the repository at this point in the history
The front-end is no longer sending this data to the server
so we can't use it in our decision-making; plus we intend for
it to be rolled out to all clients anyway.
  • Loading branch information
rfk committed Dec 4, 2016
1 parent bff1d2c commit 764c96a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 42 deletions.
18 changes: 0 additions & 18 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,24 +509,6 @@ var conf = convict({
doc: 'signin unblock sample rate, between 0.0 and 1.0',
default: 1.0,
env: 'SIGNIN_UNBLOCK_RATE'
},
supportedClients: {
doc: 'support sign-in unblock for only these clients',
format: Array,
default: [
'web',
'oauth',
'iframe',
'fx_firstrun_v1',
'fx_firstrun_v2',
'fx_desktop_v1',
'fx_desktop_v2',
'fx_desktop_v3',
'fx_ios_v1',
'fx_ios_v2',
'fx_fennec_v1'
],
env: 'SIGNIN_UNBLOCK_SUPPORTED_CLIENTS'
}
},
hpkpConfig: {
Expand Down
11 changes: 0 additions & 11 deletions lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ module.exports = config => {
return true
}

// While we're testing this feature, there may be some funky
// edge-cases in device login flows that haven't been fully tested.
// Temporarily avoid them for regular users by checking the `context` flag,
const context = request.payload &&
request.payload.metricsContext &&
request.payload.metricsContext.context

if (signinUnblock.supportedClients.indexOf(context) === -1) {
return false
}

// Check to see if user in roll-out cohort.
return isSampledUser(signinUnblock.sampleRate, uid, 'signinUnblock')
},
Expand Down
13 changes: 0 additions & 13 deletions test/local/features_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ describe('features', () => {
const email = 'blee@mozilla.com'
const request = {
payload: {
metricsContext: {
context: 'iframe'
}
}
}
// First 27 characters are ignored, last 13 are 0.02 * 0xfffffffffffff
Expand All @@ -202,7 +199,6 @@ describe('features', () => {
unblock.enabled = true
unblock.sampleRate = 0.02
unblock.allowedEmailAddresses = /.+@notmozilla.com$/
unblock.supportedClients = [ 'wibble', 'iframe' ]
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when email is not allowed and uid is not sampled')

unblock.forcedEmailAddresses = /.+/
Expand All @@ -215,15 +211,6 @@ describe('features', () => {
unblock.allowedEmailAddresses = /.+@notmozilla.com$/
unblock.sampleRate = 0.03
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), true, 'should return when uid is sampled')


request.payload.metricsContext.context = ''
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when context is not supported')


request.payload.metricsContext.context = 'iframe'
unblock.enabled = false
assert.equal(features.isSigninUnblockEnabledForUser(uid, email, request), false, 'should return false when feature is disabled')
}
)

Expand Down

0 comments on commit 764c96a

Please sign in to comment.