cern-sis / issues-inspire

0 stars 0 forks source link

record editor conflict handling is incorrect when patches remove list items #353

Open michamos opened 1 year ago

michamos commented 1 year ago

when there are conflicts on a record where the patch would remove some list item and that patch gets applied, all the subsequent patches for the same list are incorrect. The list index in those patches applied to the initial list, but removal of an element shifts all subsequent indices.

michamos commented 1 year ago

This is currently blocked by #335

karolina-siemieniuk-morawska commented 1 year ago

TECH NOTES:

In json-store.service.ts in removeJsonPatch function, patchIndex value is wrong. When an item is removed from patchesByPath list, the indices change because length of the list change.

  1. Store the original index as an Input() parameter in < patch-actions /> component
  2. Change the removeJsonPatch function to take the correct index from Input() parameter
karolina-siemieniuk-morawska commented 1 year ago

PR: https://github.com/inveniosoftware-contrib/ng2-json-editor/pull/544

michamos commented 1 year ago

@karolina-siemieniuk-morawska why am I assigned? Do I need to test it before release?

karolina-siemieniuk-morawska commented 1 year ago

The task is currently suspended due to the need to change the core functionality of the project in order to fix the underlying cause of this issue.