parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
308 stars 69 forks source link

`saveAll` doesn't handle pointers #387

Closed dblythy closed 2 years ago

dblythy commented 2 years ago

New Issue Checklist

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 received object. Errors are not thrown using children.first.save()

Expected Outcome

Objects to save.

Environment

Client

Server

Database

Logs

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this issue!

vdkdamian commented 2 years ago

On the latest versions of iOS 16 and macOS, saveAll is actually broken.

cbaker6 commented 2 years ago

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.

dblythy commented 2 years ago

You're awesome @cbaker6 👏

cbaker6 commented 2 years ago

Thanks for reporting the issue!