Skip to content

Keeping non-empty nested objects #161

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

Merged
merged 3 commits into from
Mar 21, 2018
Merged

Keeping non-empty nested objects #161

merged 3 commits into from
Mar 21, 2018

Conversation

schmidt-sebastian
Copy link
Contributor

This fixes #157

There is an edge case in merge() that the specified example hits. When we parse 'o.c.x': firebase.firestore.FieldValue.delete(), we replace the entire contents of the current target object with null. That means that both o.b and o.c no longer exist when we try to append to o.c. We need to preserve the existing data if the object is non-empty.

This is basically the same fix as #119, but expanded to also apply at any level within an object.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 21, 2018
@codecov
Copy link

codecov bot commented Mar 21, 2018

Codecov Report

Merging #161 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #161   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        1729   1729           
=====================================
  Hits         1729   1729
Impacted Files Coverage Δ
src/document.js 100% <100%> (ø) ⬆️

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 1f98dd7...a65dab2. Read the comment docs.

@schmidt-sebastian schmidt-sebastian merged commit dde2233 into master Mar 21, 2018
@schmidt-sebastian schmidt-sebastian deleted the nestedupdates branch May 22, 2018 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure in update with multiple nested deletions
3 participants