Deleting elements may cause malformed data

Created on 15 December 2023, 11 months ago
Updated 28 January 2024, 9 months ago

Problem/Motivation

We observe orphaned and misattributed elements when deleting elements. The causes are not fully clear yet, this issue should provide a place to investigate.

Ways for creating malformed data

- (1): Deleting an element and then restoring it with CTRL+Z / Undo causes the element to be still be marked as deleted.
- (2): Moving an element to a different parent creates two patch requests. If one of them fails, the stored data is incorrect (wrong
parent on moved element or wrong children list on source or target element)
- (3): Deleting elements did not properly mark them as deleted and didn't mark them as unpublished.

Proposed resolution

- (1): On restoring an element, set both deleted and published status to 0 and disable redo/undo.
- (2): Only call target element by checking childrens list before saving component and create data consistency on backend by altering source element / moved element.
- (3): Properly adress the field value of "deleted" and set "status" to 0 on deletion.

Remaining tasks

User interface changes

- Undo/redo is no longer avaiable (as intended by Design).

API changes

- Deleted elements are also marked as unpublished.
- The debugger now can also handle styles properly and deletes or unpublishes as well

Data model changes

None

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇨🇭Switzerland pvbergen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024