-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(login): let users opt-out of sync when signing in to Firefox #2534
Conversation
Requires mozilla/fxa#2534 in production
Requires mozilla/fxa#2534 in production
5d051dc
to
c8b9477
Compare
c8b9477
to
c0402e7
Compare
b8e7728
to
54cc493
Compare
@shane-tomlinson @vbudhram I hope you have time to look at this for Firefox 71 / FxA 147 👐 |
packages/fxa-content-server/app/scripts/models/auth_brokers/fx-sync-channel.js
Show resolved
Hide resolved
packages/fxa-content-server/app/scripts/models/reliers/browser.js
Outdated
Show resolved
Hide resolved
packages/fxa-content-server/app/scripts/templates/choose_what_to_sync.mustache
Show resolved
Hide resolved
packages/fxa-content-server/app/scripts/views/choose_what_to_sync.js
Outdated
Show resolved
Hide resolved
packages/fxa-content-server/app/scripts/views/choose_what_to_sync.js
Outdated
Show resolved
Hide resolved
packages/fxa-content-server/app/scripts/views/mixins/signin-mixin.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladikoff Did a first pass at this, but will do another. Is there a custom build of FF that I can use to test this?
@@ -44,7 +44,7 @@ import Session from './session'; | |||
import Storage from './storage'; | |||
import StorageMetrics from './storage-metrics'; | |||
import SupplicantRelier from '../models/reliers/pairing/supplicant'; | |||
import SyncRelier from '../models/reliers/sync'; | |||
import BrowserRelier from '../models/reliers/browser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dig the name 👍🏽
} else if ( | ||
this._isServiceSync() || | ||
// context v3 is able to sign in to Firefox without enabling Sync | ||
this._searchParam('context') === Constants.FX_DESKTOP_V3_CONTEXT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make sure we update documentation where needed.
response.capabilities && response.capabilities.multiService; | ||
this.relier.set('multiService', multiService); | ||
if (multiService) { | ||
this.relier.set('service', response.clientId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little unclear to me, what is the clientId
in this case? Sync or one of the services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add some docs for it., but to explain here:
we return the OAuth client id for Desktop Firefox in order to replace some uses of service=sync on the backend
@@ -20,6 +20,10 @@ const QUERY_PARAMETER_SCHEMA = { | |||
// context is not available when verifying. | |||
context: Vat.string().min(1), | |||
country: Vat.string().valid(...AllowedCountries), | |||
// user is signing into the browser and declined to Sync | |||
doNotSync: Vat.boolean(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is declinedSync
a better name here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, the button is called Don't sync...
. I think this var name should be fine.
Thank you! |
54cc493
to
f4b3caf
Compare
When signing in, I am presented with the screen that asks whether I want to Sync. If I click the blue button to sync the device, CWTS displays and then I am redirected to the SMS form immediately: If I click the browser's "back" button from there, then "this.onFormSubmitComplete is not a function" shows up in the console. |
Which I think makes sense since there is no return function here? fxa/packages/fxa-content-server/app/scripts/models/auth_brokers/fx-sync-channel.js Line 306 in f4b3caf
|
Hey @vladikoff, nice work! I was able to do some more testing after applying the return fix. Here some notes:
|
f4b3caf
to
aeda104
Compare
Sorry the loginData issue has now been fixed, I accidentally refactored it out... |
Yeap different, patch, filed in |
yea! ff now sends client id |
9ed7455
to
9527a87
Compare
@shane-tomlinson @vbudhram please try now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vladikoff, this LGTM 👍!
packages/fxa-content-server/app/scripts/models/auth_brokers/fx-sync-channel.js
Outdated
Show resolved
Hide resolved
9527a87
to
c9f6a95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two small questions, otherwise r+!
|
||
const SCREEN_CLASS = 'screen-would-you-like-to-sync'; | ||
|
||
const View = FormView.extend( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the account already created and email sent when this view is displayed? If so, does this view need to poll similar to CWTS in case the user verifies, or are we punting on that b/c of boomerang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boomerang + I think in most cases when there's a choice of SYNC vs NOT-Sync, we want to wait for the user...
@ryanfeeley might confirm
|
||
assert.isTrue($('body').hasClass(View.SCREEN_CLASS)); | ||
it('does not poll', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same scenario as #2534 (comment) , I spoke to @ryanfeeley and for now with email verification we do not poll when there's a choice of not syncing
Requires mozilla/fxa#2534 in production
Requires mozilla/fxa#2534 in production
Requires mozilla/fxa#2534 in production
Fixes #2396
Blocks mozilla/application-services#1690
Testing this change
You can use this build of Firefox https://queue.taskcluster.net/v1/task/Z5Bu_T3oTrqcyUEKoml0Ug/runs/0/artifacts/public/build/target.dmg
Open:
http://127.0.0.1:3030/signin?&context=fx_desktop_v3&entrypoint=fxa_app_menu
(no sync parameter)
Patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7e412555d8d027f8e0c8b0b4ad5488a0e3e4f3b7
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1577690