web3.storage
web3.storage copied to clipboard
It should be possible to update/replace a pin with the same CID
There are some cases where it's desired to update the name
, meta
, and origins
fields of a pin request with a given CID using the replace pin endpoint.
Currently, the web3.storage pinning API returns the following 400 error when attempting to update those fields with the same CID.
https://github.com/web3-storage/web3.storage/blob/bfa88cbb330274b287de90ca7d4b244919f18a5f/packages/api/src/pins.js#L253-L256
Related: https://github.com/ipfs-shipyard/pinning-service-compliance/issues/124
cc @mbommerez seems quick to add in the PSA v2 initiative
Scenario:
- When you replace a Pin Request with the same CID but different metadata, we get an error.
We need to double check the API spec and try to replicate.
There's some context here...
Wating to get an answer from the team there.
I wonder if we should go ahead anyway and have the replace always return a pin with the same requestid
.
Discussed with @olizilla.
We should go ahead and allow for update-like operations but still, keep the behavior consistent with the current implementation and compliance checks here for now.
That means a new pin it's always created and a different requestid
is returned by the endpoint.
We can then try to get some alignment and discuss an improved approach in the spec repo with the team.