Parse.File is saved even Parse.Object is failed

I’m trying to save file and associated object together like this:

const object = Parse.Object.extend("Object");
const file = new Parse.File(fileName, { base64: fileData },fileMimeType);

object.set("file",file);
...//Other parameters

object.save();

Parse file is saved and still exist even object is failed to save. Is this normal behaviour? Do I have to handle error myself and delete file in catch block?

Yes. That’s the current behavior. The file is saved before attempting to save the object.

1 Like