-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Pass parameter "transaction" to the Parse Server #1090
Conversation
@@ -230,6 +232,11 @@ const RESTController = { | |||
} | |||
} | |||
|
|||
const transaction = options.transaction; | |||
if (transaction) { | |||
payload.transaction = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to lint your code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am quite new to this and don't know what needs to be done exactly. Can you give me some advises how to get started?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just run npm run lint
or yarn lint
If you are using yarn in the command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the Contributing Guide for all your testing and linting needs.
Nice! Thanks for contributing. Could you please add a test case? |
@davimacedo Can you take this over and add the test cases? You know more about how transactions in parse work better than anyone. |
Sure. I will work on this. |
@davimacedo Any updates? |
Codecov Report
@@ Coverage Diff @@
## master #1090 +/- ##
=========================================
- Coverage 92.28% 92.2% -0.08%
=========================================
Files 54 54
Lines 5235 5223 -12
Branches 1172 1172
=========================================
- Hits 4831 4816 -15
- Misses 404 407 +3
Continue to review full report at Codecov.
|
Sorry for the delay. I am working on this now. |
@dplewis @mfkenson I started worked on the tests here but there is a problem with this implementation. In the case you have more objects to be saved/destroyed than the batch size, the SDK will split it in more than one batch and it will be generated two transactions in the server side. I think we can solve it using two different approaches:
Thoughts? |
@davimacedo I think that would be a great approach. I tried that here and ran into an issue. The issue is that we wouldn't be be able to find cycles in |
I've just checked this problem and it will be very hard to be solved now. The not saved dependent objects need to go in a first batch because there is no warranty they will be executed in first place in the server side if we send them all together with the objects that depend on them. And if we have more batched sent to the server separately we cannot ensure the transaction. So, to simplify the solution and have a first version of this feature in the next release I suggest we simply do two verifications:
Do you agree @dplewis ? |
Thats the only solution I can come up with. We will have to document it well. |
@mfkenson Can you please grant me access to this PR so I can fix linting and maybe try and perform some tests? @davimacedo Any suggestions on how to start writing tests for this? :) |
Hi guys. I am working on this (to include the validations and the tests) but I found out a bug in Parse Server when deleting objects in a transaction. I am working now on a first PR to Parse Server before fixing this one here. |
@davimacedo Thanks. Please let me know whether I can be of assistance. |
Hi guys, Great work so far
But there is something I don't understand when it fails, it sends up to |
Maybe. You can set it via |
In this way not only it would not retry it again, but it also shows the problem as well. |
That makes sense. Would you be willed to continue this PR? |
Sorry my bad I just checked this FIX: Transaction should only abort when all promises finished #5878 PR and you fixed this problem there but it still lacks a retry option which is always 5 times but it does not log into the server which is ok I guess |
@davimacedo Hi guys, any updates on this? |
Its Sep 2023 and there is an ominous comment above that says someone deleted this feature. Does that mean we are not going to get Transactional Integrity in the JS SDK? |
@mfkenson just wanted to know if there's any other pr/issue for reference since you closed this one. |
@mfkenson ??? |
@davimacedo Hey, have you fixed this problem? Can I create a new PR with the transaction: true flag now? |
@davimacedo Thank you for your patience! I apologize for the delay. it took me three years to get back to this 😅. I was surprised that this hadn't been completed yet, so I went ahead and created a PR to address it. Here’s the link to the PR: #2265. |
#922
Did I miss anything?