pydo icon indicating copy to clipboard operation
pydo copied to clipboard

Just created droplets not immediately listed on `.list()` responses.

Open fikrapdso opened this issue 7 months ago • 5 comments

I don't really know this is part of the client cache or the api-v2 itself. So i created the issue in api-v2 repo as well https://github.com/digitalocean/api-v2/issues/202.

The droplet not listed in the droplets list response even after successful request to create droplet endpoint. Request using pydo

droplets = client.droplets.create({
            "name": "xxx",
            "region": "nyc1",
            "size": "xxx",
            "image": "xxx",
...

Response

{"droplet": {"id": 1234567,
  "name": "xxxxxx",
  "memory": 245760,
  "vcpus": 20,
  "disk": 720,
  ...
  "status": "new",
  ...
}}

But in the list it show 0 containers with the name

{"droplets": [], "links": {}, "meta": {"total": 0}}

After couple of seconds then it actually listed

{"droplets": [{"id": 123456789,
   "name": "xxxxxx",
   "memory": 245760,
   "vcpus": 20,
   "disk": 720,
   ...
   "status": "new",
   ...
}]}

fikrapdso avatar May 20 '25 03:05 fikrapdso

I would like to work on this issue

HridimanSarmah avatar Oct 07 '25 15:10 HridimanSarmah

hi, i would like to work on this issue. Please assign it to me. @fikrapdso

naikmubashir avatar Oct 07 '25 15:10 naikmubashir

assign

aniketsingh1023 avatar Oct 07 '25 15:10 aniketsingh1023

Hi @fikrapdso I can reproduce this behavior the droplet creation API returns success, but it doesn’t appear in client.droplets.list() until a short delay (likely due to eventual consistency).

I’d be happy to help improve the SDK here. One idea would be to add a helper like wait_for_droplet_visible(id, timeout=30) or mention this in the create() docstring so users know it’s expected behavior.

Would you be open to a small PR adding such a helper or doc note?

krish57-bit avatar Oct 07 '25 15:10 krish57-bit

/assign

kushagras22 avatar Oct 12 '25 12:10 kushagras22