holochain / clutter

Fully distributed twitter built on holochain
161 stars 22 forks source link

Fix multiple anchors bug #82

Closed willemolding closed 6 years ago

willemolding commented 6 years ago

I found a bug in the anchors zome that prevents the creation of a new anchor type once the root anchor has been committed.

This can be seen in the newly added test case in anchors.json. The first new anchor type passes but fails creating a second type. This was not tested for previously.

This bug was caused by an error in anchors.js where the variable rootAnchorTypeHash was set to the response of a get() rather than the hash itself. This was then used as the base of a link, causing an error. This only occurrerd in the conditional branch where the root anchor had already been created.

Bug is fixed and an additional test case included.