Multiple move actions with index -1 get stored in reverse order

When moving multiple nodes into a new parent requesting items to be added using index -1 the moved nodes end up in reversed order. The expected behavior is that the order would be preserved.

Starting from document

* from 
  * 1
  * 2
* to

and then issuing a POST https://dynalist.io/api/v1/doc/edit request with payload

{
	"token": "...",
	"file_id": "...",
	"changes": [
		{
			"action": "move",
			"node_id": "<id for '1'>",
			"parent_id": "<id for 'to'>",
			"index": -1
		},
		{
			"action": "move",
			"node_id": "<id for '2'>",
			"parent_id": "<id for 'to'>",
			"index": -1
		}
	]
}

the result is

* from 
* to
  * 2
  * 1

where the order 1, 2 of source nodes is reversed in the destination.

Is this a protip or a complaint lol

Is this a protip or a complaint lol

It was meant as a bug report.

Oh I see. I get it. Yeah, I wonder why it does that. Maybe it doesn’t treat a list of changes in one API call as an ordered list, but as an unordered set. Maybe try splitting up as two API calls? Just a guess.