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: Local state wrong on multiple set operations on same property #2116

Closed
wants to merge 6 commits into from

Conversation

mortenmo
Copy link
Contributor

@mortenmo mortenmo commented Apr 27, 2024

Pull Request

Issue

Closes: #2115
Closes: #1451

Approach

When local state has multiple set/unset ops on the same base property, use the result of the previous instead of always going back to the server version for every Op to allow them to chain.

The test included fails until the fix is in place.

Tasks

  • Add 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: local state wrong on multiple set operations on same property fix: Local state wrong on multiple set operations on same property Apr 27, 2024
Copy link

Thanks for opening this pull request!

Copy link

codecov bot commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72bc9ac) to head (da3121c).
Report is 15 commits behind head on alpha.

Additional details and impacted files
@@             Coverage Diff             @@
##            alpha     #2116      +/-   ##
===========================================
+ Coverage   99.98%   100.00%   +0.01%     
===========================================
  Files          61        64       +3     
  Lines        6185      6208      +23     
  Branches     1499      1504       +5     
===========================================
+ Hits         6184      6208      +24     
+ Misses          1         0       -1     

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

@mtrezza mtrezza requested a review from a team April 27, 2024 20:35
@dplewis
Copy link
Member

dplewis commented Apr 27, 2024

@mtrezza @mortenmo A PR for this has already been opened. Try copying the test over from that PR. I'll review.

#1451

@mortenmo
Copy link
Contributor Author

I really need to check existing PRs better :) . The fixes looks basically identical, so feel free to commit that one and I can close this one. I added the #1450 test case here just to be sure and it does also pass.

@mstniy
Copy link
Contributor

mstniy commented May 1, 2024

Hey. I made some changes to #1451 . The patch also handles doubly-nested objects now, it used to be still broken in that case. I also modified the regression test to also include this scenario.

@mtrezza
Copy link
Member

mtrezza commented May 1, 2024

Is this PR made obsolete by #1451? If not, which one should be merged first, in case order matters?

@mstniy
Copy link
Contributor

mstniy commented May 1, 2024

I believe so. I copied the new regression test in this branch over to my branch, and it does pass there also.

I would suggest #1451 to be merged in favor of this one, as that one implements a more robust deep cloning logic after today's changes, evidenced by the regression test here passing there, but not vica versa.

@mtrezza
Copy link
Member

mtrezza commented May 1, 2024

Superseded by #1451

@mtrezza mtrezza closed this May 1, 2024
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.

Local state of objects not correct if setting multiple properties
4 participants