question

rambalac avatar image
rambalac asked

Wrong result on node children or filtered nodes list after move

Some node was moved with POST: { {metadataUrl}}/nodes/{toparentId}/children But if just after that you request [i]{ {metadataUrl}}/nodes/{toparentId}/children[/i] or [i]{ {metadataUrl}}/nodes?filters=parents:{toparentId}[/i] you get among other nodes that some node again, but even its parents does not contain parent id used in the request. Message was edited by: rambalac
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hi rambalac, Some move requests can be asynchronous, depending on if the node being moved is a folder or a file. This can also be a race condition between when the node is moved and when the search index is updated. How long after the move operation are the queries incorrect? Do they stay incorrect or does it go away after a short time?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rambalac avatar image
rambalac answered
Incorrect result happens with in about half a second, later it's correct. But what race condition here if server is already sending item without parentid used in request? Obviously server already has information about parent change. Yes, workaround is simple [i]Send folder children request -> from response remove all children whose parentId does not contain parentId in request[/i]. At least documentation should mention that filtered request can return response with items not matching request. Message was edited by: rambalac
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
This is expected behavior. Node storage and node searching are separate systems with eventual consistency. We will update our documentation to be more explicit about this behavior. Thanks!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.