atom / github

:octocat: Git and GitHub integration for Atom
https://github.atom.io
MIT License
1.1k stars 392 forks source link

Uncaught TypeError: atomGitRepo.refreshStatus is not a function #930

Open AMDChris opened 7 years ago

AMDChris commented 7 years ago

[Enter steps to reproduce:]

  1. Stage Changes
  2. Enter Commit Message
  3. Click Commit

Atom: 1.18.0 x64 Electron: 1.3.15 OS: Microsoft Windows 7 Enterprise Thrown From: github package 0.3.3

Stack Trace

Uncaught TypeError: atomGitRepo.refreshStatus is not a function

At C:\Users\cpw\AppData\Local\atom\app-1.18.0\resources\app\node_modules\github\lib\github-package.js:537

TypeError: atomGitRepo.refreshStatus is not a function
    at GithubPackage.refreshAtomGitRepository (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/github-package.js:537:44)
    at GithubPackage.subscriptions._eventKit.CompositeDisposable.contextPool.onDidChangeWorkdirOrHead.context (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/github-package.js:165:18)
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at emit (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/models/workdir-context-pool.js:65:45)
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at WorkdirContext.subs.add.observer.onDidChangeWorkdirOrHead (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/models/workdir-context.js:130:83)
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at FileSystemChangeObserver.didChangeWorkdirOrHead (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/models/file-system-change-observer.js:71:24)
    at _this3.currentFileWatcher.debounceMS (~/AppData/Local/atom/app-1.18.0/resources/app/node_modules/github/lib/models/file-system-change-observer.js:109:28)

Commands

     -5:14.1.0 github:toggle-git-tab (atom-pane.pane.active)
     -4:45.3.0 tabs:close-all-tabs (div.title.icon.icon-git-commit)
     -4:40.7.0 github:toggle-git-tab (atom-pane.pane.active)
     -4:35.8.0 github:toggle-github-tab (atom-pane.pane.active)

Non-Core Packages

atom-beautify 0.29.26 
atom-html-preview 0.1.22 
atom-inky-snippets 1.1.0 
atom-material-syntax 1.0.6 
atom-material-syntax-dark 1.0.0 
atom-material-syntax-light 0.4.6 
atom-material-ui 2.0.4 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
busy-signal 1.4.3 
docblockr 0.10.3 
emmet 2.4.3 
git-controlhub 0.4.0 
haskell-grammar 0.4.0 
highlight-selected 0.13.1 
intentions 1.1.2 
js-refactor 0.7.5 
language-babel 2.65.2 
language-graphql 0.9.0 
language-ini 1.19.0 
language-lua 0.9.11 
language-ocaml 1.9.5 
language-regexp 1.0.1 
language-rust 0.4.10 
language-swift 0.5.0 
language-thrift 1.0.2 
linter 2.1.4 
linter-eslint 8.2.1 
linter-jshint 3.1.2 
linter-sass-lint 1.7.4 
linter-ui-default 1.6.1 
MagicPython 1.0.10 
menu-manager 0.6.0 
merge-conflicts 1.4.5 
minimap 4.28.2 
minimap-highlight-selected 4.6.1 
minimap-pigments 0.2.2 
nuclide 0.232.0 
nuclide-format-js 0.0.36 
open-recent 5.0.0 
pigments 0.39.1 
refactor 0.11.4 
regex-railroad-diagram 0.17.0 
scope-inspector 1.0.1 
set-syntax 0.3.2 
sort-lines 0.14.0 
tool-bar 1.1.0 
vibrant-ink 1.0.1 
rsese commented 7 years ago

Thanks for the report! I couldn't reproduce the error on Windows 10 and Atom 1.18.0 - can you confirm if the error is reproducible and if so, can you reproduce in safe mode (atom --safe)?

ungb commented 7 years ago

I tried this on windows 7 ultimate x64 bit and couldn't repro either.

AMDChris commented 7 years ago

Yes, I can reproduce the issue.

After further testing it appears that even just saving a file so that the Git tab refreshes the changes listed for the repository triggers the error as well. Originally I'd just opened a file that was part of an existing Git repository and then tried to commit the unstaged changes that the Git tab showed for the repository.

The error doesn't appear to get thrown when the Git tab updates when I stage changes and they go from the unstaged to staged lists. It just appears to happen when something new gets added to the unstaged changes list or once a commit is done and all the changes that had been staged get removed from that list.

The issue also occurs when running atom in safe mode.

BinaryMuse commented 7 years ago

Interesting — this code path is just to inform Atom's internal Git information that things have changed (in order to update the tree-view and gutter colors) when we detect a certain class of change. I'm not sure why it'd be throwing; we'll look into it. Thanks!