randy3k / remote-atom

rmate for atom
https://atom.io/packages/remote-atom
MIT License
85 stars 16 forks source link

Remote atom does not update files until Atom window closed #4

Closed RomainMuller closed 10 years ago

RomainMuller commented 10 years ago

Hey,

I've recently started having a problem where remote-atom doesn't upload the updated version of files until I close Atom's main window - and even then it's not always granted.

I'm not so sure how to go around troubleshooting that - do you have any suggestions?

randy3k commented 10 years ago

that's strange, It was working for you? I didn't push any new commit recently. Is there any error msg from the console?

randy3k commented 10 years ago

And it is still working for me with the most updated version of atom.

RomainMuller commented 10 years ago

Meh - now I just tried ant it works again. Really weird. Well let's resolve that and I'll come back if the problem happens again - hopefully there'll be some kind of useful info in the logs. Sorry the the fuss :-/

randy3k commented 10 years ago

No problem

RomainMuller commented 10 years ago

Hey,

Jos so you know... I think I found a way to reproduce the issue and I don't believe it sits in your code.

Essentially, if I remote-edit a new file (i.e. it doesn't exist on the remote machine), it appears a bug in my linter extension causes all plugins to drop off that specific tab somehow... What I see in you log looks like follows:

[ratom] received connection from 127.0.0.1 remote-atom.coffee:132
[ratom] create /var/folders/61/gpv4h95539n7fwl076y822bhr5yvck/T/eR0X6z2pFf/spec/controller/self_service_controller_spec.rb remote-atom.coffee:27
[ratom] opening /var/folders/61/gpv4h95539n7fwl076y822bhr5yvck/T/eR0X6z2pFf/spec/controller/self_service_controller_spec.rb remote-atom.coffee:69
Error: spawn ENOTDIR
  at exports._errnoException (util.js:742:11)
  at ChildProcess.spawn (child_process.js:1160:11)
  at Object.exports.spawn (child_process.js:993:9)
  at CommandRunner.module.exports.CommandRunner.createChildProcess (/Users/rmuller/.atom/packages/atom-lint/lib/command-runner.coffee:48:21)
  at CommandRunner.module.exports.CommandRunner.runWithEnv (/Users/rmuller/.atom/packages/atom-lint/lib/command-runner.coffee:13:13)
  at CommandRunner.module.exports.CommandRunner.run (/Users/rmuller/.atom/packages/atom-lint/lib/command-runner.coffee:10:6)
  at Rubocop.module.exports.Rubocop.runRubocop (/Users/rmuller/.atom/packages/atom-lint/lib/linter/rubocop.coffee:44:12)
  at Rubocop.module.exports.Rubocop.run (/Users/rmuller/.atom/packages/atom-lint/lib/linter/rubocop.coffee:13:6)
  at LintRunner.module.exports.LintRunner.lint (/Users/rmuller/.atom/packages/atom-lint/lib/lint-runner.coffee:78:12)
  at LintRunner.module.exports.LintRunner.activate (/Users/rmuller/.atom/packages/atom-lint/lib/lint-runner.coffee:59:6)
  at LintRunner.module.exports.LintRunner.switchLinter (/Users/rmuller/.atom/packages/atom-lint/lib/lint-runner.coffee:48:6)
  at LintRunner.module.exports.LintRunner.startWatching (/Users/rmuller/.atom/packages/atom-lint/lib/lint-runner.coffee:20:6)
  at LintView.module.exports.LintView.initialize (/Users/rmuller/.atom/packages/atom-lint/lib/lint-view.coffee:26:17)
  at LintView.View (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/lib/space-pen.js:146:25)
  at new LintView (/Users/rmuller/.atom/packages/atom-lint/lib/lint-view.coffee:11:3)
  at Object.module.exports.injectLintViewIntoEditorView (/Users/rmuller/.atom/packages/atom-lint/lib/atom-lint.coffee:69:20)
  at /Users/rmuller/.atom/packages/atom-lint/lib/atom-lint.coffee:29:8
  at atom-workspace.attachedCallback (/Applications/Atom.app/Contents/Resources/app/src/workspace-view.js:94:18)
  at atom-workspace.handler (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:102:34)
  at atom-workspace.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at atom-workspace.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:253:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:166:19)
  at TextEditorView.jQuery.fn.trigger (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:56:23)
  at TextEditorView.module.exports.TextEditorView.afterAttach (/Applications/Atom.app/Contents/Resources/app/src/text-editor-view.js:153:19)
  at callAttachHooks (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/lib/space-pen.js:343:67)
  at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app/src/pane-element.js:199:9)
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:254:22)
  at Pane.module.exports.Pane.addItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:325:14)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:299:14)
  at /Applications/Atom.app/Contents/Resources/app/src/workspace.js:447:16
  at _fulfilled (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:787:54)
  at self.promiseDispatch.done (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:816:30)
  at Promise.promise.promiseDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:749:13)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:557:44
  at flush (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:378:11)
 /Applications/Atom.app/Contents/Resources/app/src/workspace.js:463

Passed this point, no matter what I do, the console remains silent, as if remote-atom (and other plugins) have stopped tracking events on the tab.

randy3k commented 10 years ago

And atom-lint works fine for existing file on remote machine? That's strange. Since /var/folders/61/gpv4h95539n7fwl076y822bhr5yvck/T/eR0X6z2pFf/spec/controller/self_service_controller_spec.rb is just an empty file and nothing special.

RomainMuller commented 10 years ago

Yah - never had an issue when editing a file that exists. If I had to guess, I'd say either atom-linter or rubocop has a bug that is triggered by a 0-byte input file. I'll bring that problem to atom-lint later on when I have more time on hand...

randy3k commented 10 years ago

oops....delete the original post accidentally...

you can run the following the atom console

atom.workspace.open("path_to_an_empty_file")

ps: the path has to be absolute, don't enter, eg "~/.bashrc"

RomainMuller commented 10 years ago

So... 1- In shell: touch /tmp/test.rb 2- In atom: atom.workspace.open("/tmp/test.rb") 3- No issue

Now, if I try to open a file that does not (yet) exist, I'm getting an error from atom-lint/rubocop (although it is different from what I get when I "remote-atom" that). Could there be that when I remote-atom the file, atom-linter somehow starts working on it before remote-atom has actually had time to physically create the /tmp file? Sounds pretty unlikely...

randy3k commented 10 years ago

remote-atom indeed creates the file then opens the file....