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

Batch child objects using transactions #94

Merged
merged 10 commits into from Mar 18, 2021
Merged

Batch child objects using transactions #94

merged 10 commits into from Mar 18, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Mar 17, 2021

Currently, when child objects are present they are saved to the server individually which requires more network calls and overhead. This was done on purpose because child objects are discovered at the ParseEncoder level and returned as an opaque Encodable object. This caused issues with using batch... This PR addresses the problem by making those opaque objects AnyCodable, allowing batch to do its thing. In addition, each batch of child objects are always sent as a transaction.

  • Enable batches child objects
  • Send child objects as transactions by default
  • Adjust test cases
  • Bug fix - linking an anonymous user was using an old sessionToken, resulting in an invalid session token error after becoming a real user
  • Add entry to changelog

This PR is non-breaking as all of the changes are under-the-hood

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #94 (e903025) into main (82cbecd) will increase coverage by 0.12%.
The diff coverage is 77.97%.

❗ Current head e903025 differs from pull request most recent head dc76154. Consider uploading reports for the commit dc76154 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   78.95%   79.08%   +0.12%     
==========================================
  Files          63       63              
  Lines        5114     5179      +65     
==========================================
+ Hits         4038     4096      +58     
- Misses       1076     1083       +7     
Impacted Files Coverage Δ
Sources/ParseSwift/API/BatchUtils.swift 100.00% <ø> (ø)
Sources/ParseSwift/API/Responses.swift 88.57% <ø> (+21.18%) ⬆️
Sources/ParseSwift/Coding/AnyCodable.swift 53.70% <ø> (-3.20%) ⬇️
...Authentication/Protocols/ParseAuthentication.swift 70.09% <50.00%> (-3.65%) ⬇️
Sources/ParseSwift/Objects/ParseUser.swift 79.16% <70.83%> (+2.70%) ⬆️
Sources/ParseSwift/API/API+Commands.swift 78.32% <93.47%> (-4.41%) ⬇️
Sources/ParseSwift/Coding/AnyEncodable.swift 30.49% <100.00%> (+0.09%) ⬆️
Sources/ParseSwift/Coding/ParseCoding.swift 89.13% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseObject.swift 77.22% <100.00%> (-0.23%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82cbecd...dc76154. Read the comment docs.

@cbaker6 cbaker6 closed this Mar 17, 2021
@cbaker6 cbaker6 reopened this Mar 17, 2021
@cbaker6 cbaker6 merged commit a99bf31 into main Mar 18, 2021
@cbaker6 cbaker6 deleted the batchChildObjects branch March 18, 2021 00:02
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.

None yet

1 participant