ipfs / ipfs-webui

A frontend for an IPFS Kubo and IPFS Desktop
https://webui.ipfs.io
MIT License
1.56k stars 488 forks source link

Files/Explore: unrecognized node type when DAG is not unixfs #1095

Closed lidel closed 5 years ago

lidel commented 5 years ago

Problem

https://github.com/ipfs-shipyard/ipfs-webui/pull/1027 introduced a clickable "Pins" counter on the "Files" screen.

It works fine with empty/new node, but I found a bug that manifests against my pretty old repo which has over 800 pins.

@hacdias let me know if the error is not something obvious, I can look at this closer and provide more info if needed.

Screenshots

2019-08-13--14-28-03

2019-08-13--14-28-47

ss-2019-08-14--13-04-28

Additional context

go-ipfs v0.4.22, ipfs-webui 2.5.0

hacdias commented 5 years ago

@lidel thanks for reporting that! Never seen that error in my life. Can objects be symlinks? Can you try calling ipfs.pin.ls() on that repo just to see if it throws?

lidel commented 5 years ago

I think the problem is webui assumes every pin is unixfs (dag-pb or raw), which is true for most of people, but not all. What is missing is support for other DAG types. Those could be displayed in read-only mode (without filesystem operations such as copy to MFS etc)

I was able to figure out steps to reproduce:

  1. ipfs pin add --recursive=false bafyreiddymapg5zcpma3iu4wingqvois6jirucn5776wdsyg5f3f65v75a (any dag-cbor node will do)
  2. Open pins in Web UI
  3. you should get error like this: ss-2019-08-14--13-04-28

Update: I get the same error when you enter dag-cbor CID in Explore screen (updated issue title to reflect that)

hacdias commented 5 years ago

What if all non unixfs CIDs link to the Inspector instead of the file viewer? The file viewer is meant for stuff that supports ipfs.files API.

And if the user tries to navigate a non unixfs link, we can suggest to use the inspector.

lidel commented 5 years ago

Opening non-unixfs pins in Explore screen sounds good. Also, non-unixfs pins should have a different icon (avoid things that look like a file, maybe a plain cube?)