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

fix: encode pointer object properties properly when batching #390

Closed cbaker6 closed 2 years ago

cbaker6 commented 2 years ago

New Pull Request Checklist

Issue Description

Batch saving objects that has other parse objects as properties are not encoded correctly, causing the server to throw errors.

Related issue: #387

Approach

Ensure properties that are already savedParseObject's are converted to Parse pointers during encoding.

TODOs before merging

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

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #390 (ae48ead) into main (50f655b) will increase coverage by 0.03%. The diff coverage is 97.22%.

@@            Coverage Diff             @@
##             main     #390      +/-   ##
==========================================
+ Coverage   89.15%   89.19%   +0.03%     
==========================================
  Files         156      156              
  Lines       14528    14553      +25     
==========================================
+ Hits        12953    12981      +28     
+ Misses       1575     1572       -3     
Impacted Files Coverage Δ
Sources/ParseSwift/API/BatchUtils.swift 100.00% <ø> (ø)
Sources/ParseSwift/Objects/ParseObject.swift 87.29% <96.96%> (+2.03%) :arrow_up:
Sources/ParseSwift/Objects/ParseUser.swift 85.80% <96.96%> (-0.50%) :arrow_down:
Sources/ParseSwift/Objects/ParseInstallation.swift 84.90% <97.22%> (-0.56%) :arrow_down:
Sources/ParseSwift/API/API+Command.swift 89.21% <100.00%> (ø)
...urces/ParseSwift/API/API+NonParseBodyCommand.swift 81.59% <100.00%> (+0.49%) :arrow_up:
Sources/ParseSwift/Coding/ParseEncoder.swift 78.03% <100.00%> (-0.21%) :arrow_down:
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 76.75% <0.00%> (+0.58%) :arrow_up:
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.