-
Notifications
You must be signed in to change notification settings - Fork 927
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
Auto switch account if user only has 1 device connected when login #5281
Auto switch account if user only has 1 device connected when login #5281
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
95ba72c
to
3941975
Compare
5e3ae88
to
b60c4a3
Compare
5f14b03
to
7ab217c
Compare
2f94d43
to
0d49333
Compare
7ab217c
to
29721ff
Compare
0d49333
to
4965dc7
Compare
<issue | ||
id="DenyListedApi" | ||
message="If you find yourself using this API in production, you're doing something wrong!!" | ||
errorLine1=" this.seamlessAccountSwitching().setRawStoredState(State(true))" | ||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> | ||
<location | ||
file="src/test/java/com/duckduckgo/sync/impl/AppSyncAccountRepositoryTest.kt" | ||
line="100" | ||
column="9"/> | ||
</issue> | ||
|
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.
Nit: For tests, think we should just suppress the lint warning instead of using the baseline (to avoid lint errors resurfacing in the future when the file is changed).
@@ -288,6 +300,7 @@ class AppSyncAccountRepository @Inject constructor( | |||
|
|||
return when (val result = syncApi.getDevices(token)) { | |||
is Error -> { | |||
connectedDevicesCached.clear() |
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.
why is this added? if there is a blip in the network and getDevices
call fails, do we want to clear the cached list?
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.
It's a convenient, quick solution, for us to have the latest response from get device in memory, so we can use it in the prompt logic. It's fine to clear on error, and only update/store on success.
29721ff
to
94f20f0
Compare
4965dc7
to
65c9705
Compare
94f20f0
to
043a10a
Compare
65c9705
to
a88564f
Compare
Task/Issue URL: https://app.asana.com/0/72649045549333/1208755822305614/f ### Description Adds metrics around dialog engagement and errors. ### Steps to test this PR _single device flow metrics_ - [x] Fresh install - [x] Go to Feature flags and enable FF seamlessAccountSwitching - [x] Create a sync account - [x] Save or copy the recovery code - [x] logout - [x] Create a new sync account - [x] Go to "Sync With Another Device", and read or paste the recovery code - [x] Ensure user is automatically switched to the other account - [x] Ensure following pixels where triggered: sync_user_switched_account _multiple devices flow metrics_ - [x] Fresh install - [x] Go to Feature flags and enable FF seamlessAccountSwitching - [x] Create a sync account - [x] Save or copy the recovery code - [x] logout - [x] Join this account -> https://app.asana.com/0/1203822806345703/1208795798275452/f - [x] you are connected to an account with more devices - [x] Go to "Sync With Another Device", and read or paste the recovery code from the first account you created - [x] Ensure you are asked to confirm switching accounts - [x] Ensure pixel is triggered: sync_ask_user_to_switch_account - [ ] Click on Cancel and ensure pixel is triggered: sync_user_cancelled_switching_account - [x] Repeat the connection but now click "Switch" - [x] Ensure pixel is triggered: sync_user_accepted_switching_account - [x] If Switch is successful, ensure pixel is triggered: sync_user_switched_account _error metrics_ - [x] Fresh install - [x] Go to Feature flags and enable FF seamlessAccountSwitching - [x] Create a sync account - [x] Save or copy the recovery code - [x] INSTEAD OF LOGOUT, DELETE THE ACCOUNT (scroll to the bottom part of the screen) - [x] Create a new sync account - [x] Go to "Sync With Another Device", and read or paste the recovery code - [x] This will fail since the account doesn't exist (you will see another error that says invalid_login_credentials, it's expected) - [x] Ensure following pixels where triggered: sync_user_switched_logout_error - [x] Going back you will be in logout state ### UI changes | Before | After | | ------ | ----- | !(Upload before screenshot)|(Upload after screenshot)|
581a091
into
feature/cristian/sync/offer_join_account_as_option
Task/Issue URL: https://app.asana.com/0/1203822806345703/1208755822305613/f
Description
Introduces logic to switch the user account if sync has only 1 device connected.
When multiple devices connected, we still ask the user.
Steps to test this PR
Feature 1
Feature 1
UI changes