There are three calls in your sample: ‘findID’, ‘save’ and ‘find’. Which of them responds with a fault?
And could you add BackScore class implementation (here - or send to support@backendless.com)
Thanks Andrey!
Can we also see your code, where you fill the user’s field and then save it?
And please provide your application ID (here or you may send it to support@backendless.com).
private(set) var score: Int {
get {
return Backendless.sharedInstance().userService.currentUser.getProperty("score") as? Int ?? 0
}
set {
Backendless.sharedInstance().userService.currentUser.setProperty("score", object: newValue)
}
}
var patientType: PatientType? {
get {
return Backendless.sharedInstance().userService.currentUser.getProperty("patientType") as? PatientType
}
set {
Backendless.sharedInstance().userService.currentUser.setProperty("patientType", object: newValue)
}
}
private(set) var questionResults: [QuestionResult] {
get {
return Backendless.sharedInstance().userService.currentUser.getProperty("questionResults") as? [QuestionResult] ?? []
}
set {
Backendless.sharedInstance().userService.currentUser.setProperty("questionResults", object: newValue)
saveCurrentUser()
}
}
AppId is 926934A4-6CD8-D1DA-FFA2-1510B0D1BF00
I also get “The request timed out.” error very often when trying to save either a user or a QuestionResult object. This is not related to my Internet connection, as I have a good Wi-Fi connection
Thanks, Andrey, this is very helpful. One more question to help us reproduce the error: you mentioned it occurs when you update the user object. Could you please let us know what properties exist in that object? The closer we can get to your use-case, the greater the odds of reproducing and eventually fixing the problem.
Keep in mind that extending or inheritance of an BackendlessUser class is not the best practice. Also you should avoid any “computed properties” in data model classes, because they can break an object serialization.
Open the project, log in as aa@aa.aa/aa, go to Settings, choose a Patient type, press Confirm. The error happens occasionly, but it’s reproducable right now.