kbase / sample_service

Service for creating, modifying, and retrieving samples
MIT License
0 stars 11 forks source link

Non-existent link ID returned when `create_data_link` is a noop #478

Open MrCreosote opened 1 year ago

MrCreosote commented 1 year ago

When using the update: True parameter with create_data_link, if the link from the UPA/data_id to the sample/version already exists, the server takes no action. However, the code [1] creates a new UUID for the link ID and returns that instead of the existing link. The DB code needs to be updated to return the prior link in this case (currently it returns the expired link ID, if any. The behavior should probably be to return the existing link (in the case of a noop) or the expired link (in the case of an expiration) along with a boolean describing which is which.

[1] https://github.com/kbase/sample_service/blob/master/lib/SampleService/core/samples.py#L391-L397