microsoft / EmbeddedSocial-iOS-SDK

SDK for interacting with the Microsoft Embedded Social service from inside your iOS app
MIT License
19 stars 11 forks source link

Followers / Following lists do not match numbers in user profile #135

Open Vadim-Bulavin opened 7 years ago

Vadim-Bulavin commented 7 years ago

Description: number of users in followers and following lists do not match the numbers in user profile.

Steps to reproduce:

  1. Get user profile

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Google AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=ya29.GluqBN41h0Hy3E6hzz6GfUJBBppU8YgFygOlcZvBlt1Xj9Ttog2ysglxrVy1d1fRXLak6szyjCyMF6cBnq8PI9bEE_lQGe31_9vocuX_tTouiiX9dWgb2EPKshCy' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/3vC_QIk24au'

Response:

{
  "userHandle": "3vC_QIk24au",
  "firstName": "Igor",
  "lastName": "Akvelon",
  "bio": "",
  "photoHandle": null,
  "photoUrl": null,
  "visibility": "Public",
  "totalTopics": 1,
  "totalFollowers": 4,
  "totalFollowing": 0,
  "followerStatus": "None",
  "followingStatus": "None",
  "profileStatus": "Active"
}
  1. Get followers

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Google AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=ya29.GluqBN41h0Hy3E6hzz6GfUJBBppU8YgFygOlcZvBlt1Xj9Ttog2ysglxrVy1d1fRXLak6szyjCyMF6cBnq8PI9bEE_lQGe31_9vocuX_tTouiiX9dWgb2EPKshCy' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/3vC_QIk24au/followers?limit=30'

Response:

{
  "data": [
    {
      "userHandle": "3ui66fSIueT",
      "firstName": "Alan",
      "lastName": "Poe",
      "photoHandle": "----8o8lDsL-ba3918ee-8431-463c-a786-4bfe8307a030",
      "photoUrl": "https://sp-ppe.azureedge.net/images/----8o8lDsL-ba3918ee-8431-463c-a786-4bfe8307a030",
      "visibility": "Public",
      "followerStatus": "None"
    },
    {
      "userHandle": "3vJYpeLwV7M",
      "firstName": "Vadim",
      "lastName": "Bulavin",
      "photoHandle": "----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "photoUrl": "https://sp-ppe.azureedge.net/images/----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "visibility": "Public",
      "followerStatus": "None"
    }
  ],
  "cursor": null
}
  1. Get following

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Google AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=ya29.GluqBN41h0Hy3E6hzz6GfUJBBppU8YgFygOlcZvBlt1Xj9Ttog2ysglxrVy1d1fRXLak6szyjCyMF6cBnq8PI9bEE_lQGe31_9vocuX_tTouiiX9dWgb2EPKshCy' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/3vC_QIk24au/following'

Response:

{
  "data": [],
  "cursor": null
}

Expected: number of users in the lists matches totalFollowers and totalFollowing fields in profile. Actual: totalFollowers = 4, totalFollowing = 0, but followers list contains 2 items and following list contains 0 items.

P.S. After some investigation we suspect that the numbers become inconsistent when profiles of some followers / following users are deleted.

Vadim-Bulavin commented 7 years ago

Same issue when trying with my profile:

  1. Get my profile:

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Facebook AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=EAAVXZAYQYTB8BAPaRX2St6VuzljDz5tWwexZCnSOZAAbldFCcA0qIS9BwFwrzuqZChCSqzjiJrDMnomMg2FK0zH2ZA6SLs7ozW5RX1NhFZA8UYv8lLwji2kqodyiB24U9EAj8QYdx9mEBcBEfKNfQjTKSPJmAgFkLwoGxUWQcn7EmXIeKESrZBNnFnJAsRsKYJKCHAnP6WlZAJ0wz42bBch7l3PXaEoVYOEd1jYzR2D51wZDZD' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/me'

Response:

{
  "userHandle": "3vJYpeLwV7M",
  "firstName": "Vadim",
  "lastName": "Bulavin",
  "bio": null,
  "photoHandle": "----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
  "photoUrl": "https://sp-ppe.azureedge.net/images/----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
  "visibility": "Public",
  "totalTopics": 5,
  "totalFollowers": 5,
  "totalFollowing": 5,
  "followerStatus": "None",
  "followingStatus": "None",
  "profileStatus": "Active"
}
  1. Get my followers:

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Facebook AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=EAAVXZAYQYTB8BAPaRX2St6VuzljDz5tWwexZCnSOZAAbldFCcA0qIS9BwFwrzuqZChCSqzjiJrDMnomMg2FK0zH2ZA6SLs7ozW5RX1NhFZA8UYv8lLwji2kqodyiB24U9EAj8QYdx9mEBcBEfKNfQjTKSPJmAgFkLwoGxUWQcn7EmXIeKESrZBNnFnJAsRsKYJKCHAnP6WlZAJ0wz42bBch7l3PXaEoVYOEd1jYzR2D51wZDZD' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/me/followers?limit=30'

Response:

{
  "data": [
    {
      "userHandle": "3v9gnzwILTS",
      "firstName": "Alex",
      "lastName": "Test",
      "photoHandle": "67564D82-0A9C-4773-B4B2-3A81147BF878",
      "photoUrl": "https://sp-ppe.azureedge.net/images/67564D82-0A9C-4773-B4B2-3A81147BF878",
      "visibility": "Public",
      "followerStatus": "None"
    },
    {
      "userHandle": "3vasrlAHhYf",
      "firstName": "Oleg",
      "lastName": "Rezhko",
      "photoHandle": null,
      "photoUrl": null,
      "visibility": "Public",
      "followerStatus": "Follow"
    },
    {
      "userHandle": "3vJYpeLwV7M",
      "firstName": "Vadim",
      "lastName": "Bulavin",
      "photoHandle": "----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "photoUrl": "https://sp-ppe.azureedge.net/images/----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "visibility": "Public",
      "followerStatus": "None"
    }
  ],
  "cursor": null
}
  1. Get the feed of users that I am following

Request: curl -X GET --header 'Accept: application/json' --header 'Authorization: Facebook AK=ec1665a4-920d-4449-b8a0-49ed374d4290|TK=EAAVXZAYQYTB8BAPaRX2St6VuzljDz5tWwexZCnSOZAAbldFCcA0qIS9BwFwrzuqZChCSqzjiJrDMnomMg2FK0zH2ZA6SLs7ozW5RX1NhFZA8UYv8lLwji2kqodyiB24U9EAj8QYdx9mEBcBEfKNfQjTKSPJmAgFkLwoGxUWQcn7EmXIeKESrZBNnFnJAsRsKYJKCHAnP6WlZAJ0wz42bBch7l3PXaEoVYOEd1jYzR2D51wZDZD' 'https://ppe.embeddedsocial.microsoft.com/v0.7/users/me/following/users?limit=30'

Response:

{
  "data": [
    {
      "userHandle": "3vC_QIk24au",
      "firstName": "Igor",
      "lastName": "Akvelon",
      "photoHandle": null,
      "photoUrl": null,
      "visibility": "Public",
      "followerStatus": "Follow"
    },
    {
      "userHandle": "3vasrlAHhYf",
      "firstName": "Oleg",
      "lastName": "Rezhko",
      "photoHandle": null,
      "photoUrl": null,
      "visibility": "Public",
      "followerStatus": "Follow"
    },
    {
      "userHandle": "3vJYpeLwV7M",
      "firstName": "Vadim",
      "lastName": "Bulavin",
      "photoHandle": "----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "photoUrl": "https://sp-ppe.azureedge.net/images/----8oE_4jY-cc8c005b-1a61-42df-bea3-b4caa0bc2f0b",
      "visibility": "Public",
      "followerStatus": "None"
    }
  ],
  "cursor": null
}

Expected: number of users in the lists matches totalFollowers and totalFollowing fields in step 1. Actual: totalFollowers = 5, totalFollowing = 5, but followers list contains 3 items and following list contains 3 items.

sharadagarwal commented 7 years ago

I have investigated this and found there is a bug on the server side. The bug is manifested if you delete a user. When a user is deleted, the server does not correctly remove that user from the count of followers and the count of followings for other users that the deleted user was following/follower. As a result, the number you see may be higher than the actual list. I have a new bug listed on our server side bug tracker.