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 diff of list of objects #22695

Merged
merged 1 commit into from
Nov 9, 2019
Merged

Conversation

tmccombs
Copy link
Contributor

@tmccombs tmccombs commented Sep 5, 2019

Fixes #21473

The previous code incorrectly compared the old value of the object with
a new value at the same index, even if the value was common to both
lists but occurs in old later. This caused confusing and wrong diffs if
you deleted an object in the middle of a list.

Fixes hashicorp#21473

The previous code incorrectly compared the old value of the object with
a new value at the same index, even if the value was common to both
lists but occurs in old later. This caused confusing and wrong diffs if
you deleted an object in the middle of a list.
@apparentlymart
Copy link
Contributor

Hi @tmccombs! Thanks for tracking this down and working on the fix.

This fix makes sense to me! It's interesting that we apparently previously had a test demonstrating the incorrect behavior, but I'm glad you spotted this incorrect behavior nonetheless and fixed it.

I'm going to merge this now for inclusion in the next release. Sorry for the delayed response. Thanks again!

@apparentlymart apparentlymart self-assigned this Nov 9, 2019
@apparentlymart apparentlymart merged commit a895a42 into hashicorp:master Nov 9, 2019
@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
@tmccombs tmccombs deleted the json-diff branch September 30, 2022 06:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON diff in plan/apply shows wrong changes
2 participants