Skip to content
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

Mantaray removed entry still persists #4808

Open
asabya opened this issue Sep 10, 2024 · 5 comments · May be fixed by #4819
Open

Mantaray removed entry still persists #4808

asabya opened this issue Sep 10, 2024 · 5 comments · May be fixed by #4819
Labels
needs-triaging new issues that need triaging

Comments

@asabya
Copy link

asabya commented Sep 10, 2024

⚠️ Support requests in an issue-format will be closed immediately. For support, go to Swarm's Discord.

Context

Bee Version: current master
System information: Mac M1

Summary

Adding and Persisting Nodes: Multiple nodes are added in the manifest, then saved.

Node Removal: Getting the saved node's reference from the previous step, a new manifest is loaded. Then one of the nodes is removed.

Persistence After Removal: The manifest is saved again after removing the node and reloaded to ensure the removed node does not reappear.

I have added a test that confirms that the removed node, img/2.png, cannot be found, verifying the removal operation. The expectation is for the system to return a mantaray.ErrNotFound error when trying to look up the removed node.

Expected behavior

This persistence should be rectified in the code logic or the test setup.

Actual behavior

Despite removing img/2.png, the removed node still persists at the end.

Steps to reproduce

  • the problem involves mantaray package I think
  • I have added a test in the mantaray_test package -> persist_test.go file.

Please see the test : https://github.com/asabya/bee/blob/4a8c3c5d994a9d91e69e7680237274667efb0ebf/pkg/manifest/mantaray/persist_test.go#L66

Possible solution

@asabya asabya added the needs-triaging new issues that need triaging label Sep 10, 2024
@ldeffenb
Copy link
Collaborator

This issue seems to be related to the mantaray-js implementation so it may be better reported in that repository.
https://github.com/ethersphere/mantaray-js

@asabya
Copy link
Author

asabya commented Sep 10, 2024

@ldeffenb Not sure what you mean actually. I have not personally used mantaray-js ever. I stumbled upon this issue while doing some experiment on bzz collection, trying to remove file/node from a manifest root node.

@ldeffenb
Copy link
Collaborator

ldeffenb commented Sep 10, 2024

There is no way that I know (knew) of to remove an individual manifest node using just the bee node APIs. From the description of what you did, I assumed (with all of the negative connotations of that word) that you were doing this external to the node with type/javascript using the mantaray-js package.

Having looked at your test, it appears that you are using the bee node package for the manifest and coding your program in golang? I haven't heard of anyone trying to do this before, and therefore I'm not certain that directly accessing the packages that make up the bee node is supported. But I'm willing to be proved worng (sic)!

https://github.com/ethersphere/bee/tree/master/pkg/manifest/mantaray

But do be aware that any data that is uploaded to the swarm cannot be directly deleted. So even if you manage to remove the manifest node (and thereby get a new root manifest reference), the original data will still be accessible on the swarm via the original references, both of the data itself and/or the old root manifest reference and suitable path.

@asabya
Copy link
Author

asabya commented Sep 10, 2024

I assumed (with all of the negative connotations of that word) that you were doing this external to the node with type/javascript using the mantaray-js package.

Yes, I am doing this external to the node. But with golang, using the packages from bee itself.

I haven't heard of anyone trying to do this before, and therefore I'm not certain that directly accessing the packages that make up the bee node is supported. But I'm willing to be proved worng (sic)!

As the packages can be imported and have the interfaces to be implemented, I can assure you it is possible. Not sure if it's officially supported, but on most of the few cases that i tried it worked. Like, adding file entries into an existing manifest, adding custom metadata to entries etc.

But do be aware that any data that is uploaded to the swarm cannot be directly deleted. So even if you manage to remove the manifest node (and thereby get a new root manifest reference), the original data will still be accessible on the swarm via the original references, both of the data itself and/or the old root manifest reference and suitable path.

Yes I am aware of the fact that anything on swarm cannot be directly deleted and content will be accessible from both references. My idea is to update the manifest and access it from a feed.

@asabya
Copy link
Author

asabya commented Sep 11, 2024

I was going through the mantaray-js repo. Saw this issue ethersphere/mantaray-js#40. I think it has the same issue as mine.

asabya added a commit to asabya/bee that referenced this issue Sep 13, 2024
@asabya asabya linked a pull request Sep 13, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triaging new issues that need triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants