bee
bee copied to clipboard
fix(api): resolve pinning failures for erasure-coded chunk
Checklist
- [x] I have read the coding guide.
- [ ] My change requires a documentation update, and I have done it.
- [ ] I have added tests to cover my changes.
- [x] I have filled out the description and linked the related issues.
Description
This change ensures that erasure-coded content can be properly pinned, maintaining data availability and integrity within the Swarm network. Issue is desribed in this comment.
This basic getter doesn't understand the replica structure of erasure-coded chunks, causing the traversal to fail when trying to pin such content.
Changed the getter to use replicas.NewGetter which is specifically designed to handle erasure-coded chunks:
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):
Testing
Steps to Reproduce the Issue:
- Upload a file using erasure coding, resulting in a specific hash (e.g.,
ffe6d7fc805ede4581af1a01d9fcedf21332cfe3353d74a4961e53c360d06342) - Attempt to pin the file using the Bee API
- Observe that the pinning operation fails, despite the file being downloadable
Example Download Command:
curl localhost:1633/bzz/ffe6d7fc805ede4581af1a01d9fcedf21332cfe3353d74a4961e53c360d06342/ -o "wiki copy.png"
Verification:
After applying this fix, the same hash should be pinable via:
curl -X POST localhost:1633/pins/ffe6d7fc805ede4581af1a01d9fcedf21332cfe3353d74a4961e53c360d06342