-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Sorry @cbaker6 but I'm having a new issue with .saveAll batch save/update operation since one of the last two commits.
I can't imagine it's because of the cloudcode name changes from #46 but maybe there is a cloud code that runs in parse-server source that I am not aware of. I scanned through #43 and I'm going to take a flyer and say it might be the skippedKeys or other changes to the batch command in API+Commands.swift. I don't see the error but I don't know enough about the return headers and body to know how it is encoded.
Also, I think Parse has always done this, but I get a success response with an array of parseerrors. So, it's a success but the saveAll failed.
Here's the code:
/// I have something like this where GameScore.scores is a [String]?
let score = GameScore(score: ["2"])
let score2 = GameScore(score: ["3"])
let scoresArray = [score, score2]
scoresArray.saveAll { results in
switch results {
case .success(let success):
var index = 0
success.forEach { success in
switch success {
case .success(let savedScore):
print("Saved \"\(savedScore.className)\" with score \(savedScore.score) successfully")
if index == 1 {
print("\(savedScore)")
}
index += 1
case .failure(let error):
print("Error saving: \(error)") // <---All the objects fail now after the recent commits and scores are not updated remotely.
}
}
case .failure(let error):
print("Error batch saving: \(error)")
}
}// This is the response from the `error` in the first try-catch
[Swift.Result<ParseApp.GameScore, ParseSwift.ParseError>.failure(ParseSwift.ParseError(code: ParseSwift.ParseError.Code.invalidKeyName, message: "Invalid field name: __type.")), Swift.Result<ParseApp.GameScore, ParseSwift.ParseError>.failure(ParseSwift.ParseError(code: ParseSwift.ParseError.Code.invalidKeyName, message: "Invalid field name: __type."))]I thought there may be some issue with a pointer, missing column, or my key strings in query, because Invalid field name:__type. in the response, but after some inspection it seems to be a potential issue with encoding the query. Everything is in order and looking at history, it seemed to work before. I could be wrong of course. I may try rolling back and testing, but for now, it would be nice to have another pair of eyes who knows Parse-Swift well.
There are no issues updating remote objects, if I do a for-loop and do individual .save.