-
-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse Swift SDK.
Issue Description
I am unable to upload objects using the saveAll()
method. I get the error: "ParseError code=105 error=Invalid field name: __type."
This is my struct:
struct PGRListItem: NVMParseObject {
var objectId: String?
var createdAt: Date?
var updatedAt: Date?
var ACL: ParseACL?
var originalData: Data?
var id: String { nvmId ?? Novem.generate_nvmId() }
var userId: String?
var nvmId: String?
var timeStamp: Date?
var deviceId: String?
var deviceName: String?
var selected: Bool?
var shops: [Shop]?
var brand: String?
var priority: Int?
var amount: Float?
var price: [String : String]?
var checkedHistory: [Date]?
var uncheckedHistory: [Date]?
var checkedTimes: Int?
var uncheckedTimes: Int?
var lastUsed: Date?
init() {
self.nvmId = Novem.generate_nvmId()
}
}
Here is my code that saves the objects.
if let synchronizableObject = synchronizableObjects.first, synchronizableObjects.count == 1 {
let object = try await synchronizableObject.save()
self.removeSynchronizingObject(object.nvmId)
try self.storeParseItems([object],
storeGroup: self.storeGroup,
encryption: self.encrypted ?? false,
fetch: .none)
} else {
let results = try await synchronizableObjects.saveAll()
try self.storeResults(results,
storeGroup: self.storeGroup,
encryption: self.encrypted ?? false)
}
Also might be important, if only one object needs to be saved, my code makes use of .save()
. Multiple objects use .saveAll()
. It's good to know that the .save()
function never throws this error.
Steps to reproduce
Using the saveAll() method
Actual Outcome
ParseError code=105 error=Invalid field name: __type.
Expected Outcome
No error
Environment
Client
- Parse Swift SDK version:
4.10.0
- Xcode version:
14.0 beta 6
- Operating system (iOS, macOS, watchOS, etc.):
iOS, macOS
- Operating system version:
iOS 16, macOS 13
Server
- Parse Server version:
4.5.0
- Operating system:
Back4app
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Back4app
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
3.6
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Back4app
Logs
Metadata
Metadata
Assignees
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed