-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object patch add-link
overwrites root node data when child is too small
#7190
Comments
Sorry for the delay, this got lost in the noise. The short version is that UnixFSv1 (the current go-ipfs filesystem format) simply doesn't support this. Unfortunately, adding support for this is rather difficult without introducing compatibility concerns. The plan has always been to switch to a "v2" UnixFS based on CBOR objects but work on this has stalled for now. |
@Stebalien Thanks for taking the time to respond. I've opened another related issue on the go-unixfs repo (ipfs/boxo#390) in which I specify what I think would go into adding support for this feature. If my assumptions are correct, I have a fix ready and can open a PR right away. The proposed solution passes the tests from both repos and seems to fix the bug, if there's any interest. |
What's your proposal, specifically? The first step here would be to open a PR against the unixfs spec in https://github.com/ipfs/specs/. |
Ah, I see your proposal. That won't work, unfortunately. It'll work for tiny files that fit into one block, but how would you handle alternative versions for large files? |
Reading back my explanation, I've failed to highlight the most important aspect : we should stop descending through the DAG when a node has only named links. This condition is expressed by the snippet Also, I don't know how to translate this into a change of spec, since I've gone about it in the spirit of fixing an implementation bug. |
Per @lidel:
Will be working on |
dag patch work is happening here: #4782 |
Version information:
go-ipfs version: 0.4.23-
Repo version: 7
System version: amd64/linux
Golang version: go1.13.7
Description:
Hello,
I was trying to add links to other versions of an image to the original's dag node. Though the links are working, accessing the root node yields a child version of the original image instead of the original.
To reproduce, we use two versions of the same image :
QmcFDihqvEwzgahFora3TU1BRZ84UJRSd2PW43j4buSs6n
Qmapcp7ey9eUyk98eEK8iDbu7VdUHVtdd1RVsP5Wvqf4Cp
Then, we run
On my machine, this yields
QmQbr75jzhPXWFi59uRUrig6U2paGwfKSe8MLuDwC5s8VL
.We can then observe that the above cid doesn't display the original, but the
small.jpg
link works and yields the same image. In testing, I have noticed that when the small image is larger (my guess is larger than chunk size), this behavior disappears.In case the images aren't available :
The text was updated successfully, but these errors were encountered: