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

feat: Add transaction to save and destroy on Parse.Object #2265

Merged
merged 10 commits into from
Oct 14, 2024

Conversation

vahidalizad
Copy link
Contributor

@vahidalizad vahidalizad commented Aug 11, 2024

Pull Request

Issue

This pull request addresses issues related to performing batch transactions.
Closes: #922

Approach

  • Added a transaction option to the save and destroy methods in the ParseObject class.
  • Implemented checks to ensure objects are serializable before creating a batch, as the server cannot save children and parents simultaneously in a single transactional batch.

Tasks

  • Add a transaction option to save and destroy in the ParseObject class.
  • Ensure that objects are serializable before initiating a batch save, as transactional operations require the batch size to match the entire input.
  • Add relevant tests.

Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: add transaction to save and destroy on parse object fix: Add transaction to save and destroy on parse object Aug 11, 2024
Copy link

Thanks for opening this pull request!

src/__tests__/ParseObject-test.js Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b50790a) to head (4c1534e).
Report is 168 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##             alpha     #2265    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           61        64     +3     
  Lines         6186      6392   +206     
  Branches      1499      1520    +21     
==========================================
+ Hits          6186      6392   +206     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vahidalizad
Copy link
Contributor Author

@mtrezza Could you please check and review the changes when you have a chance?

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; let's see if someone from the JS team has any feedback before we merge. Btw, would you be interested to get team to get notified when someone is requesting feedback on their PR?

Is this a fix or a feature? From the issue description it looks more like a new feature?

@mtrezza mtrezza requested a review from a team October 7, 2024 14:18
@mtrezza mtrezza changed the title fix: Add transaction to save and destroy on parse object fix: Add transaction to save and destroy on Parse.Object Oct 7, 2024
@vahidalizad
Copy link
Contributor Author

Looks good; let's see if someone from the JS team has any feedback before we merge. Btw, would you be interested to get team to get notified when someone is requesting feedback on their PR?

Is this a fix or a feature? From the issue description it looks more like a new feature?

Thanks for the feedback! I agree, this is more of a feature than a fix.
Regarding the notification for the team when someone is requesting feedback on their PR, could you clarify how that would work? I'm not sure I fully understand the suggestion.

@mtrezza
Copy link
Member

mtrezza commented Oct 9, 2024

Regarding the notification for the team when someone is requesting feedback on their PR, could you clarify how that would work? I'm not sure I fully understand the suggestion.

You'd just be added to the review team here on GitHub. When someone submits a PR and the PR is ready for review, then you'd get a notification and if you have some time you can look over it and provide feedback. No obligation though.

@mtrezza mtrezza changed the title fix: Add transaction to save and destroy on Parse.Object feat: Add transaction to save and destroy on Parse.Object Oct 9, 2024
@vahidalizad
Copy link
Contributor Author

You'd just be added to the review team here on GitHub. When someone submits a PR and the PR is ready for review, then you'd get a notification and if you have some time you can look over it and provide feedback. No obligation though.

Sure, thanks for the trust! I'd be happy to help as much as I can.

@mtrezza mtrezza merged commit 2b55bdf into parse-community:alpha Oct 14, 2024
12 checks passed
parseplatformorg pushed a commit that referenced this pull request Oct 14, 2024
# [5.3.0-alpha.4](5.3.0-alpha.3...5.3.0-alpha.4) (2024-10-14)

### Features

* Add transaction to save and destroy on `Parse.Object` ([#2265](#2265)) ([2b55bdf](2b55bdf))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-alpha.4

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performing batch transactions
3 participants