Fault 1007 when trying to save a double property.

When I try to save an object with a double property, then I get this error when the double property has no ‘.’ in it.

when the doubleProperty is set to 10.0 it saves fine, but when I set it to 10 then I get this error:

Fault! Error Updating BLProjectObject ‘test3’: FAULT = ‘1007’ [Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.] <Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.>

Do you save it from Java, PHP, Obj-C, Swift, JS or REST?

Swift!

If you send 10 (without dot) it is an integer, not a double…

No, it’s declared as a double, and it’s a double value that I get back from Apple’s location manager.

Can you look into it or suggest a Solution? Can I force it somehow to become 10.0 instead of 10? (Feels more like a workaround to me, but if it can be done im fine with it :))

What is the data type of the column on the server? If you change it to DOUBLE, it should work just fine.

Hi Mark,

That’s the problem: it is already set to double.

Do you run it on a device or emulator? Can you give me the specs so I can try reproducing it? I tried on iPhone6 Plus emulator and it works just fine for me (with the backend configured to use DOUBLE for the column).

I did run it on the iOS 9.2 (13C75) iPhone 6 simulator, using XCode 7.2.1

I don’t know if it matters: But the double value is stored in a related object.

ProjectObject ->>(One to Many) CustomProperty (here is the value stored).

Do you make the call to save ProjectObject which contains a collection of CustomProperty objects? I need to be able to reproduce the error first. The more data/code you share, the closer we get to either resolving the problem or getting a ticket written up which goes to developers.

Hi Mark,

Can I PM / Email you the code segments directly?

btw: I never had this problem before, it was just there all of a sudden. It might be related with the save function not working correctly (that also was there all of a sudden), so I replaced that with the suggested create method. Im not saying that this causes the problem, but it could be.

Anyway small code sample:

private func createBLProjectObject(projectObject:CDProjectObject) {

 syncIsRunning = true
 
 // First convert the projectObject
 let blProjectObject = blParser.convertProjectObject(projectObject)
 
 print ("Try uploading blProjectObject: \(blProjectObject) with owner: \(blProjectObject.owner?.email)")
 
 // Upload the object
 BackendlessManager.sharedInstance.backendless.persistenceService.create(blProjectObject, response: {(response:AnyObject!) -> Void in
 
 print ("ProjectObject Upload OK: ",response.objectId)
 
 // Upload any customproperties that contain NSData
 self.dataToUpload(projectObject)
 
 }, error: {(fault:Fault!) -> Void in
 print ("Fault! Error Creating BLProjectObject '\(projectObject.name)': ",fault)
 self.uploadFailed()
 })
 }

Log Output:

Try uploading blProjectObject: <ProProject.BLProjectObject: 0x13ea638d0> with owner: Optional(“xxx@xxx.xx”)
Fault! Error Creating BLProjectObject ‘test’: FAULT = ‘1007’ [Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.] <Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.>

You’re welcome to email the details to support@backendles.com.

Thanks,
Mark

Hi Mark,

I just recreated the error with a very simple sample project

App Id: CBB6488B-4CC0-D857-FF35-93D6F6295C00

Backendless Classes:

class Menu: NSObject {
 var name: String?
 var menuItems: [MenuItem] = []
}
 
 
 



class MenuItem: NSObject {
 var name: String?
 var price: NSNumber?
}

ViewController:

class ViewController: UIViewController {
 



 override func viewDidLoad() {
 super.viewDidLoad()
 // Do any additional setup after loading the view, typically from a nib.
 
 let price1 : Double = 10.1010
 let price2 : Double = 2
 
 let menuItem1 = MenuItem()
 menuItem1.name = "item1"
 menuItem1.price = price1
 
 let menuItem2 = MenuItem()
 menuItem2.name = "item2"
 menuItem2.price = price2
 
 let menu = Menu()
 menu.name = "Funky Food"
 menu.menuItems.append(menuItem1)
 menu.menuItems.append(menuItem2)
 
 let dataStore = Backendless.sharedInstance().persistenceService.of(Menu().ofClass())
 
 // Upload the object
 dataStore.save(menu, response: {(response:AnyObject!) -> Void in
 print ("Menu Uploaded OK: ",response.objectId)
 
 }, error: {(fault:Fault!) -> Void in
 print ("Fault! Error Creating Menu '\(menu.name)': ",fault)
 })
 }
 



 override func didReceiveMemoryWarning() {
 super.didReceiveMemoryWarning()
 // Dispose of any resources that can be recreated.
 }
 



 



}

Run it once:

Fault! Error Creating Menu ‘Optional(“Funky Food”)’: FAULT = ‘1007’ [Unable to save object - invalid data type for properties - price. You can change the property type in developer console.] <Unable to save object - invalid data type for properties - price. You can change the property type in developer console.>

Thanks, Barry! This is helpful. I am assigning a ticket to a developer so we can replicate the problem internally.

Regards,
Mark

Hi Mark,

Can you keep me posted on this subject? It’s rather important for us as storing multiple double’s per object is in the core of our application?

Also: This didn’t happen before (I mean a couple of weeks ago), so something must have changed on your side.

Thanks for your support!

Hi Barry,

Our current understanding of the problem is it is in the SDK (client-side) rather than the server. Depending on the emulator you use, the bool/numeric data types are not retrieved correctly.

Have you updated the SDK recently?

Regards,
Mark

Hi Mark,

I think I updated like two weeks ago. I will update now -> what is the best place to get the latest version?

The latest version is always in the github repo:

Regards,
Mark

Sorry Mark, updating iOS SDK didn’t help:

Fault! Error Creating BLProjectObject ‘Wetwetwe’: FAULT = ‘1007’ [Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.] <Unable to save object - invalid data type for properties - doubleProperty. You can change the property type in developer console.>