POST friendships/create caching the post request

twitterkit
sdk

#1

I am noticing that the POST friendships/create endpoint is somehow caching the request while not on network (no wifi, no data) , which is great. However, the result seem slightly inconsistent between the Twitter iOS App, twitter.com website and API response (via GET friends/list).

Upon the device returning back to network (connecting back to the internet), I am noticing that eventually the API and Website shows that I am following the user, but the iOS App still shows that I am not following the user.

my code is in Swift is pretty basic and uses the Latest TwitterKit SDK and this is how it looks-

let params: [String:String] = ["user_id":self.userIDStr]
let request = client.urlRequest(withMethod: "POST", url: "https://api.twitter.com/1.1/friendships/create.json", parameters: params, error: &clientError)
            
client.sendTwitterRequest(request, completion: { (response, data, connectionError) in
       //some code to update the UI in the viewController
 })

Screenshots from the Mobile App, website (taken at the same time), and the data received by the API

GET friends/list response-

id_str: "63485337", profile_image_url_https: "https://pbs.twimg.com/profile_images/855193282841907204/aVwHE5Fw_normal.jpg", verified: true, following: true, screen_name: "notch", name: "Notch"

So the question is -
a) Is this endpoint really caching the request in absence of network connectivity?
b) Why this inconsistency between the website, iOS App, and API?

Also noticing the tweet time stamp between the app and the website is inconsistent, but that’s not the issue here. :slight_smile: