Merges two changesets into one, deduplicating entities by id within each
bucket (added/modified/removed) with last-write-wins semantics.
Use this when a single logical operation requires multiple engine calls that
each produce a changeset. For example, creating a conclusion premise requires
both createPremiseWithId and setConclusionPremise, each returning a
changeset — mergeChangesets combines them into one changeset suitable for
a single persistence call.
A merged changeset. Entity categories that are empty after merge
are omitted from the result.
Throws
If any entity ID appears in more than one bucket
(added/modified/removed) within the same category after merge. This
indicates a logic error in the caller.
Merges two changesets into one, deduplicating entities by
idwithin each bucket (added/modified/removed) with last-write-wins semantics.Use this when a single logical operation requires multiple engine calls that each produce a changeset. For example, creating a conclusion premise requires both
createPremiseWithIdandsetConclusionPremise, each returning a changeset —mergeChangesetscombines them into one changeset suitable for a single persistence call.