Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

remove error alert when no internet and add error description in the popover #309

Merged
merged 0 commits into from
Jan 22, 2018

Conversation

rvermeiren
Copy link
Contributor

Remove error alert when no internet and add error description in the popover

Please be sure to read the contributor's guide before submitting any pull requests.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions.

Description of the Change

To avoid to generate an error when the internet is not connected, delete the error throw when initialization fails and move the message in the popover launch when the internet is not connected.

I also try to change the error thrown when the connection is lost since the initialization but don't have understood yet how it's work.

Alternate Designs

As suggested in the issue (#238), remove the error thrown when initialization of teletype. And pass the message to the popover. It's suggested because not having internet is not really an error.

Benefits

An error less

Possible Drawbacks

Maybe another error can catch and pass to the popover.

Verification Process

Run atom without internet and with teletype installed. --> Tooltip contains the error and suggest to restart.

Run atom with internet --> correct behaviour.

I can't run the local test on my computer as it seems to be an error with the postgresql database.

Applicable Issues

Issue (#238) :
Show error message in tooltip when initialization fails

Copy link
Contributor

@jasonrudolph jasonrudolph left a comment

Choose a reason for hiding this comment

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

@rvermeiren: Thanks for this contribution. 🙇 Below are a few changes that will be needed in order to get this pull request merged. I hope this helps.

@@ -16,6 +16,7 @@ class PackageInitializationErrorComponent {
render () {
return $.div({className: 'PackageInitializationErrorComponent'},
$.h3(null, 'Teletype initialization failed'),
$.p(null, 'Error : ' + this.props.initializationError.message ),
Copy link
Contributor

Choose a reason for hiding this comment

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

The space before the closing parenthesis is causing the linter to fail the build: https://travis-ci.org/atom/teletype/jobs/331883465#L550

@rvermeiren: Can you please remove that space? You can run the linter locally with npm run lint to verify that the issue is resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Once you resolve that linter failure, the CI build will run the tests, and you'll see that this test fails. Can you update that test to reflect the changes implemented in this pull request?

// this.notificationManager.addError('Failed to initialize the teletype package', {
// description: `Establishing a teletype connection failed with error: <code>${error.message}</code>`,
// dismissable: true
// })
Copy link
Contributor

Choose a reason for hiding this comment

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

We prefer to delete code that we're no longer using. Can you please delete this commented-out code and the else block that contains it?

@jasonrudolph
Copy link
Contributor

I captured a before-and-after screenshot in case it's helpful for anyone else reviewing this pull request:

Before

Error notification and error shown in popover.

image

After

No error notification. Instead, the error message appears in the popover.

image

@rvermeiren
Copy link
Contributor Author

rvermeiren commented Jan 22, 2018

Hi @jasonrudolph , first, thank you for your attention. This is my first contribution on Github and I'm very thankful for your help and review.
I have fix the lint issue and the comment code you find.

For the testing, I remove two test because the scenario was wrong. When internet is turned of, initializationError not allow to share portal or join one. So, these scenario were good before because the test catch the old exception in place of the good one (tested in another file). So i just update the good test and remove the two other.

I hope this is ok and my contribution is good. Regards, Rémy

Copy link
Contributor

@jasonrudolph jasonrudolph left a comment

Choose a reason for hiding this comment

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

So i just update the good test and remove the two other.

👍

I hope this is ok and my contribution is good.

Thanks for contributing! 🍻

@jasonrudolph jasonrudolph merged commit 30b14a4 into atom:master Jan 22, 2018
jasonrudolph added a commit that referenced this pull request Jan 22, 2018
Squashed commit of the following:

commit 30b14a4
Author: Jason Rudolph <[email protected]>
Date:   Mon Jan 22 17:43:24 2018 -0500

    Tweak error message formatting

commit 5108745
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:45:47 2018 +0100

    remove incorrect scenario

commit e114a5d
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:37:33 2018 +0100

    update test

commit fef7fde
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:32:32 2018 +0100

    trying to make test more clear and generic

commit 31e2c46
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:24:07 2018 +0100

    fix test issues with isEquals

commit df6b6e7
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:17:57 2018 +0100

    fix error in test

commit 87b2811
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 20:05:47 2018 +0100

    remove some fail test because i think it's unconsistent

commit 0f0ac85
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 19:58:36 2018 +0100

    fix pull request issue with lint, delete not used code and edit test to fit the new behaviour

commit f6f24c6
Author: Vermeiren Rémy <[email protected]>
Date:   Mon Jan 22 15:16:28 2018 +0100

    remove error alert when no internet and add error description in the popover
@rvermeiren
Copy link
Contributor Author

Thank you for helping me with my first contribution. I think it was a great experience and I will probably continue to contribute further.

I see that one check not passed with the merge. Can I do something about that ?

image

@winstliu
Copy link
Contributor

Nice work @rvermeiren! We would love to see you contribute more :).

You do not have to worry about the pending status check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants