Parse-Swift
Parse-Swift copied to clipboard
`saveAll` doesn't handle pointers
New Issue Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
- [x] I can reproduce the issue with the latest versions of Parse Server and the Parse Swift SDK.
Issue Description
Parse Swift doesn't properly convert Parse Object to Pointers on .saveAll
, leading to schema mismatch errors.
Steps to reproduce
var parent = Parent()
parent.name = "name"
do {
let response = try parent.save()
let children = childObjects.map{ obj -> Child in
obj.parent = response
return obj
}
try children.saveAll()
print("\n\n\n all saved")
} catch let error {
print(error)
}
Actual Outcome
Schema mismatch, expected Pointer<Parent> received object. Errors are not thrown using children.first.save()
Expected Outcome
Objects to save.
Environment
Client
- Parse Swift SDK version:
4.7.0
- Xcode version:
13.4.1
- Operating system (iOS, macOS, watchOS, etc.):
macOS
- Operating system version:
12.2
Server
- Parse Server version:
alpha
- Operating system:
macos
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
localhost
Database
- System (MongoDB or Postgres):
mongodb
Logs
Thanks for opening this issue!
- 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
On the latest versions of iOS 16 and macOS, saveAll is actually broken.
In your example, please add more details for your ParseObjects along with using async/await or completion blocks instead of synchronous calls as sync calls will be deprecated and shouldn’t be used when making networking calls.
You're awesome @cbaker6 👏
Thanks for reporting the issue!