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 context for cascade-saving and saving existing object #6735

Merged
merged 8 commits into from
Jul 2, 2020

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jun 16, 2020

Fixes issues with context when saving objects:

  1. Fixes issue that no context is set when saving an existing object:
const obj = new Parse.Object("TestObject");
await obj.save(null);
await obj.save(null, { context: { a: 'a' } });
  1. Fixes issue that context is lost when cascade-saving objects so that context is inherited by child objects (obj2 in this example):
const obj = new Parse.Object("TestObject");
const obj2 = new Parse.Object("TestObject2");
obj.set("obj2", obj2);
await obj.save(null, { context: { a: 'a' } });

Requires:

closes #6736

@dplewis
Copy link
Member

dplewis commented Jul 2, 2020

Thanks for bumping the SDK, I was waiting for the PR from Synx. Can you run npm install to update the package lock?

@mtrezza
Copy link
Member Author

mtrezza commented Jul 2, 2020

Yes, it's already running. I gotta head out now, if CI fails I'll take a look at it in a couple of hours.

@dplewis
Copy link
Member

dplewis commented Jul 2, 2020

It looks good to me, can you remove the comments that are self documenting?

@mtrezza
Copy link
Member Author

mtrezza commented Jul 2, 2020

You mean these // Save object comments and alike in the tests ?

@codecov
Copy link

codecov bot commented Jul 2, 2020

Codecov Report

Merging #6735 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6735      +/-   ##
==========================================
- Coverage   93.89%   93.88%   -0.01%     
==========================================
  Files         169      169              
  Lines       12047    12048       +1     
==========================================
  Hits        11311    11311              
- Misses        736      737       +1     
Impacted Files Coverage Δ
src/RestWrite.js 93.67% <100.00%> (-0.17%) ⬇️
src/batch.js 92.00% <100.00%> (+0.16%) ⬆️

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 41fc7c1...b9f3245. Read the comment docs.

@mtrezza
Copy link
Member Author

mtrezza commented Jul 2, 2020

Looks like a false positive in coverage, ready to merge.

Copy link
Member

@dplewis dplewis left a comment

Choose a reason for hiding this comment

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

LGTM!

@dplewis dplewis merged commit f095dff into parse-community:master Jul 2, 2020
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.

Fix context when updating / cascade-saving objects
2 participants