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

Crash on package deactivate #383

Closed
sorear opened this issue Jan 24, 2016 · 2 comments
Closed

Crash on package deactivate #383

sorear opened this issue Jan 24, 2016 · 2 comments

Comments

@sorear
Copy link

sorear commented Jan 24, 2016

To reproduce:

  1. Open devtools
  2. Make sure git-plus is fully active
  3. Disable, upgrade, or uninstall git-plus

Observed stack trace:

Error deactivating package 'git-plus' TypeError: disposable.dispose is not a function
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:25:29
    at Set.forEach (native)
    at CompositeDisposable.module.exports.CompositeDisposable.dispose (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:24:26)
    at Object.module.exports.deactivate (/Users/sorear/.atom/packages/git-plus/lib/git-plus.coffee:133:20)
    at Package.module.exports.Package.deactivate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:647:21)
    at PackageManager.module.exports.PackageManager.deactivatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:593:12)
    at PackageManager.module.exports.PackageManager.update (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:366:23)
    at PackageCard.module.exports.PackageCard.update (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-card.js:656:34)
    at HTMLButtonElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-card.js:300:24)
    at HTMLButtonElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLButtonElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4121:28)

The issue appears to be the @subscriptions.add call at

@subscriptions.add $(item).find('.git-branch').on 'click', (e) ->
, which adds a JQuery object to an array of Atom disposables; I suspect that the @subscriptions.add may be completely unneeded, since the event listeners will be cleaned up when the branch node is removed from the DOM anyway, but I could be wrong there.

I've noticed two other issues which are probably related but I can't prove it:

  1. When updating git-plus, the spinner continues to say the update is in progress for an inordinately long time (minutes); maybe the crash is causing problems with event delivery?
  2. Sometimes after an update I'll have two copies of the "pushpin" icon in my status bar.
@jpo
Copy link
Contributor

jpo commented Jan 27, 2016

This looks like it could be related to atom/event-kit#10

@akonwi
Copy link
Owner

akonwi commented Feb 3, 2016

Good catch about line 156. I think that's it because the jQuery 'on' method returns a node which doesn't have a 'dispose' method.

I can't duplicate the pushpin issue so If the icon duplicates again, open another issue

@akonwi akonwi closed this as completed Feb 3, 2016
akonwi added a commit that referenced this issue Feb 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants