Skip to content

[Bug]: MergePatchUpdate behaves badly with subsequent mutations #8976

@bterlson

Description

@bterlson

Describe the bug

Because $applyMergePatch assigns the mutated properties to the target properties, you get this fun situation:

const mpModel = getMergePatchFromGraph();
const clone = $.type.clone(mpModel);
$.type.finishType(mpModel);
mpModel.properties === clone.properties; // true!

I think it's an important invariant that the clones have fresh properties. This caused all sorts of strange behavior that was hard to debug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions