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

[8.x] Fix comparison for arrays (#208171) #208215

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

The comparison helper is not considering arrays - this means when
comparing two objects with arrays, it will always find a diff because to
the `!==` operator, the arrays are not the same:
```ts
calculateObjectDiff(
 { alpha: [1, 2, 3], beta: [4, 5, 6] },
 { alpha: [1, 2, 3], beta: [4, 5, 6] })
```

This PR fixes this by recursing into each element of the array.

(cherry picked from commit 938f471)
@kibanamachine kibanamachine merged commit ee53464 into elastic:8.x Jan 24, 2025
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @flash1293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants