sirixdb/sirix-svelte-frontend

Bug in the diffing-view

JohannesLichtenberger opened this issue · 1 comments

Precondition:

Execute the following script in the cli:

resource json-diff json resource
create --data '["test", "test"]'
delete --nodekey 2
update --nodekey 1 --data 'diff'
delete --nodekey 3
update --nodekey 1 --data '[{"interesting": "!"}]'

Then in the Svelte-frontend compare revision 4 and 5.

Screenshot from 2020-05-10 17-34-25

However, the children are swapped.

It's inserted as the first child actually:

default/json-diff/resource (JSON)> diff -s 4 -e 5
[{'insert': {'data': '[{"interesting":"!"}]',
             'depth': 2,
             'deweyID': '1.3.2.3',
             'insertPosition': 'asFirstChild',
             'insertPositionNodeKey': 1,
             'nodeKey': 5,
             'type': 'jsonFragment'}}]

I believe that there are many edge cases not handled, and I will have to test them all. In the meantime, this specific bug is fixed.