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

feat: add ipfs connection indicator and notifications #802

Merged
merged 17 commits into from
Sep 21, 2018
Merged

Conversation

olizilla
Copy link
Member

@olizilla olizilla commented Sep 19, 2018

This is an initial sketch of an idea on how to inform users about IPFS connection issues. It works for both api errors and window.ipfs errors, but it is very high level; just enough info to let the user know that we're not able to talk to ifps at the moment.

  • Add an IPFS connection status indicator to the top right. It's yellow/orange when when we get errors back from the stats api call, which we poll every 3s, so is a useful indicator of connection health.
  • Add a dismissible toast style notification to let you know that there is a problem.
  • The IPFS request error notification is replaced with a "Normal IPFS service has resumed" if it wasn't dismissed, when the connection comes back, otherwise it just stays hidden.

notify-error

TODO

- show the api address when connect via http
- otherwise show api provider (window.ipfs, embedded js-ipfs)

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
- got to await the doc title test othewise it resolves after the test ends
- e2e tests are carried out on a small screen. the notificaiton div was covering the settings link so it couldnt be clicked.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
- update to ipfs-redux-bundle v3.0.1
- tweak notify dismiss reactor to more reliably auto dismiss

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@hacdias
Copy link
Member

hacdias commented Sep 20, 2018

@olizilla oops: found a bug: when going to /welcome it doesn't show the API address in input box. It might be an issue on ipfs-redux-bundle. Will take a look.

@hacdias
Copy link
Member

hacdias commented Sep 20, 2018

@olizilla I think that issue is fixed by ipfs-inactive/ipfs-redux-bundle#12

- also update ipfs-redux-bundle v3.1.0

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Member Author

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Member Author

I'm moving the i18n out of the bundle and into the Notify component and adding tests for the bundle.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla olizilla requested review from lidel and fsdiogo September 20, 2018 14:43
@olizilla
Copy link
Member Author

I'd like to merge this to revamp and then move revamp to master 🚢💨
@lidel @alanshaw @fsdiogo pls take a look

# Notify
- show error when ipfs goes away.
- show ok when it comes back.
- dismiss the the ok after 2s
Copy link
Contributor

Choose a reason for hiding this comment

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

dismiss the the ok after 2s 3s

return { ...state, show: false }
}

if (action.type.match(/_FETCH_FAILED$/) || action.type.match(/^FILE_\w+_FAILED$/)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The actions are FILES_*, so this should be:

action.type.match(/^FILES_\w+_FAILED$/)`

}
}

if (action.type.match(/_FETCH_FINISHED$/) || action.type.match(/^FILE_\w+_FINISHED$/)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here: FILES_.

src/components/connected/Connected.js Show resolved Hide resolved
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Looks 👌

I see potential for small tweaks:

  • Having spinner in left top corner and connection indicator in the right one is bit distracting.
    Perhaps we could merge them and just animate connection indicator instead of having a separate spinner? (This could be a separate PR)

  • Let's make indicator interactive (would be cool to do it before this is merged):

    • cursor: help or cursor: pointer

    • Clicking on connection status indicator should display already existing troubleshooting guide:

- add a retry-init bundle to track ipfs init failures and retry
- Make connection indicator a link to welcome page
- Improve language around network traffic graphs

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Member Author

@lidel very good plan! I have made it so. The spinner is gone. The connection indicator is a link.

For bonus points we now also have auto-retry ipfs init when you get stuck on the welcome page if you open the app with no daemon running. If you go start your daemon, the page will now auto update to show you are now connected, which feels nice.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Member Author

retry-ipfs-init

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla
Copy link
Member Author

Gonna merge this and see if i can do anything about the bundlesize in a separate PR

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

👌

@olizilla olizilla merged commit 3847f78 into revamp Sep 21, 2018
@olizilla olizilla deleted the notify branch September 21, 2018 10:58
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.

4 participants