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

fix: stop crashing pin screen on a single ipfs.files.stat error #1121

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

lidel
Copy link
Member

@lidel lidel commented Aug 20, 2019

This PR makes pin listing more robust by never throwing errors returned by
ipfs.files.stat for individual pins. Fixes #1095 for all repos.

Motivation

Error handling introduced in #1115 was bit naive and when anything other than 'non unixfs' error was detected, it was re-thrown. This broke rendering of pin list on my end:

My repo has some bizzare DAGs, which provided good sandbox for testing shortcomings of old error handling:

unhandled-errors-2019-08-20--16-32-16

Changes

We just mark non-unixfs or errored items as 'unknown' and continue.
That way user is able to list all pins, and if they click on an 'unknown' item that produces an error, it will be displayed in IPLD Explorer (Inspector), so no information is lost.

This makes pin listing more robust by never throwing errors returned by
ipfs.files.stat for individual pins.

We just mark those items as 'unknown' and continue.
That way user is able to list all pins, and if they click on 'unknown'
item that produces an error, the error will be displayed in IPLD
Explorer (Inspector).
@lidel lidel requested a review from hacdias August 20, 2019 15:16
@lidel lidel mentioned this pull request Aug 20, 2019
@hacdias hacdias mentioned this pull request Aug 20, 2019
16 tasks
Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks lidel 😄

@hacdias hacdias merged commit 174b85b into master Aug 20, 2019
@hacdias hacdias deleted the fix/robust-pin-list branch August 20, 2019 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Files/Explore: unrecognized node type when DAG is not unixfs
2 participants