boxo icon indicating copy to clipboard operation
boxo copied to clipboard

pin: cleanup pin indexes and storage

Open hacdias opened this issue 2 years ago • 1 comments

Currently, the pinning/pinner package is built in such a way that the internals would technically allow for multiple pins of the same CID, while in practice that is not possible. In addition, it makes maintenance tasks or new features, such as #537, more complicated.

The idea here would be to simplify the current indexes to only having one value per key. In addition, when updates are made, avoid deleting and writing a new pin again to a different key in the datastore. Instead, reuse the same key and simply override the the information. Perhaps the ID could even be based on the CID (currently it is random).

hacdias avatar Jan 08 '24 14:01 hacdias

built in such a way that the internals would technically allow for multiple pins of the same CID

That was intended to support the future capability of named pins, which would allow multiple pins for the same CID. If there is no need to support named pins then the pinner package can be simplified as outlined above, and possibly in additional ways.

gammazero avatar Mar 27 '25 20:03 gammazero