-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixes Twitter publicize connections #9629
Conversation
@@ -161,7 +161,8 @@ public void onErrorResponse(VolleyError volleyError) { | |||
|
|||
Map<String, String> params = new HashMap<>(); | |||
params.put("keyring_connection_ID", Long.toString(keyringConnectionId)); | |||
if (!externalUserId.isEmpty()) { | |||
// Sending the external id for Twitter connections result in an error | |||
if (!externalUserId.isEmpty() && !serviceId.equals(PublicizeConstants.TWITTER_ID)) { |
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.
wdyt about using TextUils.isEmpty(externalUserId)
and PublicizeConstants.TWITTER_ID.equals(serviceId)
to avoid potential NPEs?
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.
Ha, I have been in Kotlin world for too long, good catch! I'll make the change later today.
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.
Addressed in dc81204.
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.
Tested, works as advertised, LGTM!
Left a note on potential NPE so, after that's addressed, feel free to
Approving
@mzorz I've addressed the possible NPE issue and merged |
Thanks for this @oguzkocer ! Will merge once CircleCI goes 💚 |
Fixes #8652.
When we tried to add a new publicize connection with the
/sites/$site/publicize-connections/new
endpoint, it complained with the following error:This is easily reproducible by:
v1.1/me/keyring-connections/
ID
of it askeyring_connection_ID
andexternal_ID
of it asexternal_user_ID
and make a request to/sites/$site/publicize-connections/new
for any of your sites. You can also use the/me/publicize-connections/new
to create a connection for all of your sitesThis Publicize service does not support setting an external user ID.
I checked Calypso and they are not sending the
external_user_ID
at all for Twitter connections. (They also send the parameters as a json object but that doesn't seem to make a difference) I initially tried to remove theexternal_user_ID
for all connection requests, but Facebook does expect it and since #8652 says the issue only affects Twitter, the most straightforward solution is to not send theexternal_user_ID
parameter for it.To test:
My Site
->Sharing
->Twitter
In my test I was able to connect 2 different Twitter accounts without any issues and a Facebook account once I add a page to my test Facebook account. I don't have a handy test account for LinkedIn or Tumblr, but this PR shouldn't change anything about them. If anyone has it handy, it'd be good to test them just in case.
Finally, I found an issue with the Facebook connections which I'll create a new issue for.
Update release notes:
RELEASE-NOTES.txt
.