Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Disable update notification for disabled packages#1005

Open
JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
JonatanPaalsson:disabled-notifications
Open

Disable update notification for disabled packages#1005
JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
JonatanPaalsson:disabled-notifications

Conversation

Copy link

JonatanPaalsson commented Oct 3, 2017

Description of the Change

The purpose of this pull request is to fix the bug where a notification is given that updates are available even though the package is disabled.

This is done by looking at all the packages in the list updatesin the package-updates-status-view.jsand then temporarily remove all disabled packages from the list when calculating the number of packages that have available updates.

A event is also introduced which is triggered by enabling or disabling a package. The purpose of this is so that the user is immediately informed if the package has an available update or it let's Atom know that the user is not interested to know if updates are available for the selected package.

Alternate Designs

An alternative is the remove all the disabled packages from the list updates completely and then add them when the package is enabled. This however would lead to that the packages won't show up in the available-updates view.

Benefits

Now all disabled packages will not trigger the update status message that appears in the lower right corner. The status message will also be updated when enabling or disabling a package.

Possible Drawbacks

The function updateTilebecomes a bit more complex and also have some impact on performance depending on how many packages that are in the updates list.

Applicable Issues

Fixes #956

Copy link
Author

JonatanPaalsson commented Oct 11, 2017

I'm having some problems writing specs for my implementation. My problem is trying to disable packages. I want to do something similar to:

expect(atom.packages.isPackageDisabled('out-dated-1')).toBe true">describe "When a package is disabled", ->
waitsForPromise ->
atom.packages.disablePackage('out-dated-1')

it "update the tile", ->
expect(atom.packages.isPackageDisabled('out-dated-1')).toBe true

This probably fails because the package is not loaded, however I'm not sure. In a similar way I'm having problem loading this package. If anyone could help me out or point me in some direction I would be very grateful.

JonatanPaalsson changed the title Disable update notification for disabled packages [WiP] Disable update notification for disabled packages Oct 30, 2017
winstliu added the needs-review label Oct 30, 2017
lee-dohm reviewed Oct 31, 2017
}
}
}

Copy link
Contributor

lee-dohm Oct 31, 2017

Choose a reason for hiding this comment

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

I believe that these two loops can be replaced with:

const updatesWithoutDisabled = this.updates.filter(update => !atom.packages.isPackageDisabled(update.name))

Copy link
Author

JonatanPaalsson Oct 31, 2017

Choose a reason for hiding this comment

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

Thank you, I refactored the code using filter instead of for-loops and no the specs seem to be working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer

lee-dohm lee-dohm left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Update status message should not count disabled packages

3 participants