Skip to content

Conversation

@alex-zywicki
Copy link

@alex-zywicki alex-zywicki commented Oct 3, 2025

This PR contains:

This PR contains 2 commits that:

  1. Recreate the bug
  2. Fix the bug

Describe the problem you have without this PR

patch`and incrementalPatch can splice out nested values #7430

Todos

  • Tests
  • Changelog

…he patch into the document using `@fastify/deepmerge` package.

This prevents an issue that can arise when calling `patch` or `incrementalPatch` with a patch value containing fields deeper that the top level of the document where values will be spliced out if the patch value does not contain a full copy of all fields instead of just the fields being patched.
@alex-zywicki alex-zywicki force-pushed the fix-patch-and-incremental-patch-for-nested-values branch from 362a10c to 832b21e Compare October 6, 2025 15:13
@alex-zywicki
Copy link
Author

After looking at the issues with the CI build related to the "object-deep-merge" package I opted to replace that with "@fastify/deepmerge" which I verified locally should build. The tests as a I wrote them still pass with the changed lib.

I also made sure that the merge behavior for arrays overwrites arrays with the "patch" value as I believe this is the behavior that is intended in patch. A lot of these 3rd party libs want to concat the arrays by default.

@alex-zywicki
Copy link
Author

@pubkey Can you approve the workflow so we can hopefully move forward with this? Or is there something you would need changed?

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.

2 participants