Request time out when updating User

I update a property on the User class after they register for Push notifications like so:

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
 backendless.messagingService.registerDevice([backendless.messagingService.currentDevice().deviceId], expiration: nil, token: deviceToken, response: { (deviceRegId) -> Void in
 UserManager.saveUserWithDeviceId({ (fault) -> Void in
 })
 }) { (fault) -> Void in
 //
 }
}

The saveUserWithDeviceId method you see above is defined like so:

 class func saveUserWithDeviceId(completed : (fault : Fault?) -> Void) {
 let backendless = Backendless.sharedInstance()
 let currentUser = Backendless.sharedInstance().userService.currentUser



 currentUser.setProperty("deviceId", object: backendless.messagingService.currentDevice().deviceId)



 backendless.userService.update(currentUser, response: { (updatedUser) -> Void in
 print("Successfully updated user: \(currentUser)")
 }) { (fault) -> Void in
 print("Server reported an error: \(fault)")
 }
 }

Now sometimes it works, but most often it doesn’t go through and the following error messages are printed in my console:

Server reported an error: FAULT = '-1001' [NSURLErrorDomain] <The request timed out.> 
error in __connection_block_invoke_2: Connection interrupted
error in __connection_block_invoke_2: Connection interrupted

Am I missing something?

This tells me the client has timed out while connecting to the service. How reliable is your internet connection?

I’m on fast wifi. All other network calls work ok

Does the deviceId property exist in the User Properties at the time when the update takes place?

Yes the property exists, however I have actually moved on from this issue as I don’t need to update a property on the User anymore.

I was using this property (deviceId) to send Push Notifications to that user’s specific device, however I found a more effective and scalable architecture is registering devices to a channel named after the User’s objectId; this way when I publish a message to that channel, all devices they are logged into receive the Push.

Loving Push with Backendless so far; thanks for the awesome support as always!