Fankserver / atom-firepad

Collaborative code editing with Atom + Firepad
MIT License
96 stars 16 forks source link

Uncaught Error: sendOperation() called with invalid operation. #25

Closed nexitem closed 8 years ago

nexitem commented 8 years ago

After I got this error I wasn't able to type in anything, I had close the file and make a new session.

  1. typing something in
  2. using undo

Atom Version: 1.3.3 System: Microsoft Windows 10 Home Thrown From: firepad package, v0.5.0

Stack Trace

Uncaught Error: sendOperation() called with invalid operation.

At C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:1645

Error: sendOperation() called with invalid operation.
    at assert (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:1645:13)
    at FirebaseAdapter.firepad.FirebaseAdapter.FirebaseAdapter.sendOperation (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:1403:5)
    at EditorClient.firepad.EditorClient.EditorClient.sendOperation (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2358:24)
    at Synchronized.firepad.Client.Synchronized.applyClient (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2066:12)
    at EditorClient.firepad.Client.Client.applyClient (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2021:30)
    at EditorClient.firepad.EditorClient.EditorClient.onChange (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2333:10)
    at AtomAdapter.EditorClient.editorAdapter.registerCallbacks.change (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2265:52)
    at AtomAdapter.firepad.AtomAdapter.AtomAdapter.onChange (C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2677:38)
    at C:\Users\nexitem\.atom\packages\firepad\lib\firepad-lib.js:2645:59
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.applyChange (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:664:27)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:834:16)
    at TextBuffer.module.exports.TextBuffer.transact (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:801:14)
    at TextEditor.module.exports.TextEditor.transact (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:1216:26)
    at C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:810:24
    at TextEditor.module.exports.TextEditor.mergeSelections (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:2092:43)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:2058:35)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:808:19)
    at TextEditor.module.exports.TextEditor.insertText (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor.js:774:19)
    at TextEditor.object.(anonymous function) [as insertText] (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\node_modules\underscore-plus\lib\underscore-plus.js:77:27)
    at TextEditorComponent.module.exports.TextEditorComponent.onTextInput (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor-component.js:448:35)
    at HTMLDivElement.<anonymous> (C:\Users\nexitem\AppData\Local\atom\app-1.3.3\resources\app.asar\src\text-editor-component.js:3:61)

Commands

     -4:46.3.0 core:redo (atom-text-editor.editor.is-focused)
     -4:44.4.0 core:paste (atom-text-editor.editor.is-focused)
     -4:32.5.0 core:save (atom-text-editor.editor.is-focused)
     -2:24.7.0 core:cut (atom-text-editor.editor.is-focused)
     -2:24.1.0 core:backspace (atom-text-editor.editor.is-focused)
     -2:20.3.0 core:save (atom-text-editor.editor.is-focused)
  2x -1:38.7.0 core:undo (atom-text-editor.editor.is-focused)
     -1:37.8.0 core:redo (atom-text-editor.editor.is-focused)
  2x -1:34.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:03.1.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:02.8.0 core:paste (atom-text-editor.editor.is-focused)
     -1:02.0 core:save (atom-text-editor.editor.is-focused)
     -0:50.7.0 core:undo (atom-text-editor.editor.is-focused)
     -0:47.6.0 core:save (atom-text-editor.editor.is-focused)
  3x -0:20.7.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:03.7.0 core:save (atom-text-editor.editor.is-focused)

Config

{}

Installed Packages

# User
firepad, v0.5.0

# Dev
No dev packages
stevenanthonyrevo commented 8 years ago

Just had the same problem, seems to me its only on happening windows. Mac seemed to work fine.

Hope we can fix this soon.

luminaxster commented 8 months ago

This is old, but it happened to me again yesterday. Be careful with the monacoEditor.onDidChangeModelContent() associated with your firepad. Use firepad.on("sync", isSync=>{/*your change logic*/}) to handle any of the change callbacks after sync. I believe monaco cancel the change events after some time and that skip breaks the sendOperation() in Firepad's firebase adapter