You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This resolves an issue that pops every now and then in which a separate issue may allow a user to authenticate with a WordPress.com account while the user is currently authenticated with another account. Upon login, the typical handling of AccountService does not replace the current default account and instead just adds a new one.
To test:
If needed, sign in to a WordPress.com account.
On the "My Sites" tab hit the + button and select "Add self-hosted site".
Instead of self-hosted credentials, enter a WordPress.com username and password different from the account that is currently authenticated.
For the site address, enter the primary site for new account, such as "username.wordpress.com".
Upon login, the newly entered account will be the only account and sites listed under the My Sites and Me tabs.
To reproduce the original issue, repeat steps above on the branch develop.
@aerych quick note based on the last visit of this issue, I'm not sold on placing the fix for this within AccountServiceFacade and setDefaultWordPressComAccount:.
However, AccountService itself tries to remain stateless with managing the default account, as does SigninWPComSyncHandler with its use of the facade. If we want to keep the logic out of the facade, I would probably suggest we don't use a facade altogether.
I took the branch for a spin and I couldn't create a dup account after the patch. Nice :)
As far as the facade being responsible for the work, I don't really have any better ideas so lets just roll with it.
We chatted about how this change could potentially be problematic if there is already an existing wpcom account in the app and I've opened #5166 to address that situation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5042
This resolves an issue that pops every now and then in which a separate issue may allow a user to authenticate with a WordPress.com account while the user is currently authenticated with another account. Upon login, the typical handling of
AccountServicedoes not replace the current default account and instead just adds a new one.To test:
To reproduce the original issue, repeat steps above on the branch
develop.Needs review: @aerych