uplink icon indicating copy to clipboard operation
uplink copied to clipboard

[Round 2] Handle copying object to the same location

Open mniewrzal opened this issue 3 years ago • 2 comments

One way to update metadata with S3 is doing server-side copy to the same location with new metadata. We should also support this case in uplink but we don't need to do full server-side copy operation but we can use UpdateObjectMetadata on uplink side when we detect that the source location is equal to the destination location.

AC:

  • extend CopyObject method to handle coping to the same location
  • use UpdateObjectMetadata metainfo endpoint to set new metadata if source location and destination location are the same and new metadata was set
  • add test cases

mniewrzal avatar Feb 15 '22 14:02 mniewrzal

I just realized that we cannot use UpdateObjectMetadata directly as CopyObject needs to return object metadata. We have two solutions:

  • adjust satellite to handle coping to the same location and return object metadata correctly
  • just return error when user wants copy to the same location (we may do this initially and later go to first point)

mniewrzal avatar Mar 09 '22 15:03 mniewrzal

We need to implement that on server side first https://github.com/storj/storj/issues/4604 After that we need to revisit if we need to do something for uplink too.

mniewrzal avatar Mar 15 '22 09:03 mniewrzal