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: when transactions enabled throw errors when needed #295

Merged
merged 4 commits into from
Dec 3, 2021
Merged

fix: when transactions enabled throw errors when needed #295

merged 4 commits into from
Dec 3, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Dec 3, 2021

New Pull Request Checklist

Issue Description

When using transactions, issues can arise when:

  1. The number of objects in the transaction are larger than the batch size
  2. When child objects haven't been saved

Currently the SDK:

  1. Adjusts the batch size to the size of the objects in the transaction. This can be problematic when the number is large
  2. Saves unsaved children as individual transactions. If parents can't save after, the original transaction can't be cancelled

Related issue: #n/a

Approach

Implement the suggestions in parse-community/Parse-SDK-JS#1090 (comment)

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@cbaker6 cbaker6 changed the title Transaction errors fix: when transactions enabled throw errors when needed Dec 3, 2021
@parse-github-assistant
Copy link

parse-github-assistant bot commented Dec 3, 2021

Thanks for opening this pull request!

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

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #295 (7c26b73) into main (1352a83) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   82.70%   82.79%   +0.08%     
==========================================
  Files         104      104              
  Lines       10638    10622      -16     
==========================================
- Hits         8798     8794       -4     
+ Misses       1840     1828      -12     
Impacted Files Coverage Δ
...s/ParseSwift/Objects/ParseInstallation+async.swift 100.00% <ø> (ø)
...ParseSwift/Objects/ParseInstallation+combine.swift 100.00% <ø> (ø)
Sources/ParseSwift/Objects/ParseObject+async.swift 100.00% <ø> (ø)
...urces/ParseSwift/Objects/ParseObject+combine.swift 100.00% <ø> (ø)
Sources/ParseSwift/Objects/ParseUser+async.swift 100.00% <ø> (ø)
Sources/ParseSwift/Objects/ParseUser+combine.swift 100.00% <ø> (ø)
Sources/ParseSwift/Objects/ParseInstallation.swift 77.29% <100.00%> (-0.43%) ⬇️
Sources/ParseSwift/Objects/ParseObject.swift 79.12% <100.00%> (+3.00%) ⬆️
Sources/ParseSwift/Objects/ParseUser.swift 79.51% <100.00%> (-0.47%) ⬇️
Sources/ParseSwift/Parse.swift 98.75% <100.00%> (ø)
... and 2 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 1352a83...7c26b73. Read the comment docs.

@cbaker6 cbaker6 merged commit ae6de04 into parse-community:main Dec 3, 2021
@cbaker6 cbaker6 deleted the transactionErrors branch December 3, 2021 04:45
@RahulLanjewar93
Copy link

@cbaker6 Hi, just wanted to know what are we doing exactly here to solve both issues.
I'll try to do the same in Parse-JS-SDK

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.

2 participants