ArtifactDB / gypsum-worker

Bare-bones ArtifactDB API with Cloudflare
https://gypsum.artifactdb.com
MIT License
1 stars 2 forks source link

Resolve the 'latest' alias in all version-specific getter endpoints. #5

Closed LTLA closed 2 years ago

LTLA commented 2 years ago

This uses a two-pass strategy to handle cases where the cached latest version has been deleted. Specifically, we try to get the resource using the cached latest, and if that fails, we delete the cache and reload the latest version from R2. This ensures that the resolution is robust to loss of versions due to expiry, though you'll still have to wait for normal cache expiration if a new latest version is added.

The project information endpoint has also been updated so that locking or lack of version metadata results in a 200 return with a status: error and some information in the anomalies property. Note that this endpoint is also version-specific and so responds properly to the 'latest' alias.