Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: async save/create/update/replace use async/await deep save #418

Merged
merged 6 commits into from
Sep 17, 2022
Merged

fix: async save/create/update/replace use async/await deep save #418

merged 6 commits into from
Sep 17, 2022

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Sep 17, 2022

New Pull Request Checklist

Issue Description

Xcode 14 throws purple warnings for hang risk at runtime due to asynchronous save/create/update/replace needing to deep save ParseObject's synchronously. It's okay for synchronous calls to have this warning as developers are choosing to hold the thread (because of the synchronous call), but this should not occur for async calls.

Related issue: #n/a

Approach

  • For Swift 5.5.2+, all async calls that need to deep save will call the async/await version of deep save.
  • Decode improper Parse Server errors as ParseError even though the server is wrong. This happens when the error thrown from the Parse Server only contains error or message, but does not contain a code.

TODOs before merging

  • Add tests
  • Decode improper Parse Server errors as ParseError even though the server is wrong
  • Add entry to changelog

@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 17, 2022

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Sep 17, 2022

Codecov Report

Base: 90.14% // Head: 90.17% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (965865a) compared to base (085f5ad).
Patch coverage: 92.72% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
+ Coverage   90.14%   90.17%   +0.03%     
==========================================
  Files         159      161       +2     
  Lines       15322    16189     +867     
==========================================
+ Hits        13812    14599     +787     
- Misses       1510     1590      +80     
Impacted Files Coverage Δ
...s/ParseSwift/Objects/ParseInstallation+async.swift 91.74% <82.10%> (-8.26%) ⬇️
Sources/ParseSwift/Objects/ParseUser+async.swift 93.49% <83.15%> (-6.51%) ⬇️
Sources/ParseSwift/Objects/ParseInstallation.swift 86.39% <92.65%> (+0.66%) ⬆️
Sources/ParseSwift/Objects/ParseObject+async.swift 96.57% <94.82%> (-3.43%) ⬇️
Sources/ParseSwift/Objects/ParseUser.swift 88.12% <96.04%> (+1.02%) ⬆️
Sources/ParseSwift/Objects/ParseObject.swift 90.10% <97.17%> (+0.51%) ⬆️
Sources/ParseSwift/API/API+Command+async.swift 100.00% <100.00%> (ø)
...ParseSwift/API/API+NonParseBodyCommand+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Types/ParseError.swift 100.00% <100.00%> (ø)
... and 3 more

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cbaker6 cbaker6 merged commit 40a7b42 into parse-community:main Sep 17, 2022
@cbaker6 cbaker6 deleted the childAsync branch September 17, 2022 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant