open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[BUG]: uploadListingImage rank not honored

Open dfrdmn opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

While creating images, consecutively, if we submit a rank > 1, the image is placed at rank 1 and previously created images are bumped down.

Steps to reproduce

  1. POST to /shops/1234/listings/5678/images with data {'image': , 'rank': 1}
  2. Image is created fine
  3. POST to /shops/1234/listings/5678/images with data {'image': , 'rank': 2}
  4. Response is something like: {'listing_id': 5678, 'listing_image_id': 12345, 'hex_code': None, 'red': None, 'green': None, 'blue': None, 'hue': None, 'saturation': None, 'brightness': None, 'is_black_and_white': None, 'creation_tsz': 1663685814, 'created_timestamp': 1663685814, **'rank': 1**, 'url_75x75': '...', 'url_170x135': '...', 'url_570xN': '...', 'url_fullxfull': '...', 'full_height': None, 'full_width': None, 'alt_text': ''}
  5. Etsy dashboard confirms that the first image is now at position 2 and this new image is at position 1

Expected behavior

The rank returned should be position 2.

Additional context

We have tried setting "overwrite": True to no avail.

dfrdmn avatar Sep 20 '22 15:09 dfrdmn

@dfrdmn When you are adding the second image (rank = 2) are you doing this to a listing that only has the one image or are you trying to replace an existing image in the second position? Also, are you passing image ids or image files in the image variable?

We just want to be sure we understand your process before we dig in too much further.

One quick note, I don't think it should matter but the documentation does say that overwrite should be true NOT True. I'm not sure if that will make a difference.

etsyachristensen avatar Sep 21 '22 20:09 etsyachristensen