Skip to content

Conversation

omkar-ethz
Copy link
Member

Description

Fixes an inconsitency with #2286 - migrate all object-typed fields to the GenericHistory delta format, not just datasetlifecyle. Using computeDeltaWithOriginals of the history plugin to construct the deltas.

Motivation

Fixes

Changes:

Tests included

  • Included for each change/fix?
  • Passing?

Documentation

  • swagger documentation updated (required for API changes)
  • official documentation updated

official documentation info

Comment on lines +46 to +49
const { delta, originals } = computeDeltaWithOriginals(previousValue, {
...previousValue,
...currentValue,
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rationale behind this logic is:
in the old backend's history (code), previousValue will contain datsetInstance[field], and currentValue will contain the fields to patch. computeDeltaWithOriginals expects both "complete" (oldObject, newObject). so we construct the newObject by overriding previousValue i.e. datsetInstance[field] with ...currentValue

@omkar-ethz omkar-ethz requested a review from minottic October 16, 2025 14:48
@omkar-ethz omkar-ethz marked this pull request as ready for review October 16, 2025 14:48
@omkar-ethz omkar-ethz requested a review from a team as a code owner October 16, 2025 14:48
@omkar-ethz omkar-ethz merged commit e1c024a into master Oct 16, 2025
13 checks passed
@omkar-ethz omkar-ethz deleted the history-migration-object-fix branch October 16, 2025 14:50
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