question

Milind Gupta avatar image
Milind Gupta asked

Problems with the list API

Hi, I am trying to use the nodes list API to get a list of nodes in a particular parent. So I use the Children listing command with the following parameters: kind:FOLDER AND name:gd1 folder gd1 is a folder I just created using the create API call. The problem is that the list query returns 0 results unless I wait for almost a second before issuing the list call. Why is this delay required. If a delay is required why does the server provide no error and just a wrong result?
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 Milind, That is a correct observation as that is expected behavior. The database layer that answers get and list calls has eventual consistency. There is a small gap of time after the create, before the entry is searchable. Kind regards, Levon
10 |5000

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

Milind Gupta avatar image
Milind Gupta answered
Hi Levon, Thank you very much for responding. What is the correct way to handle this then? Should I have a delay at my end to make sure I get the right listing? Or do I have to use the changes API or some other API to make it transparent? Thanks, Milind
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 Milind, Those are both correct answers. Wait+list will technically work, but list calls can get pretty heavy, and it wouldn't be very fast. The changes API would probably be what you need. Cheers, Levon
10 |5000

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