atom / teletype

Share your workspace with team members and collaborate on code in real time in Atom
https://teletype.atom.io
MIT License
2.41k stars 324 forks source link

Uncaught TypeError: this.resolveConnectionPromise is not a function #51

Closed Ben3eeE closed 7 years ago

Ben3eeE commented 7 years ago
  1. Bryant closed the connection
  2. Robert and I disconnected
  3. Bryant Opened a connection
  4. Robert was able to join
  5. I got a notification that it failed to join
  6. I tried to connect again and saw this

image

Atom: 1.22.0-dev-006ebc744 x64 Electron: 1.6.9 OS: Microsoft Windows 10 Pro Thrown From: real-time package 0.1.0

Stack Trace

Uncaught TypeError: this.resolveConnectionPromise is not a function

At C:\Users\bene\.atom\packages\real-time\node_modules\@atom\real-time-client\lib\star-overlay-network.js:203

TypeError: this.resolveConnectionPromise is not a function
    at StarOverlayNetwork.receiveConnectionAck (/packages/real-time/node_modules/@atom/real-time-client/lib/star-overlay-network.js:203:10)
    at StarOverlayNetwork.receive (/packages/real-time/node_modules/@atom/real-time-client/lib/star-overlay-network.js:167:12)
    at Function.module.exports.Emitter.simpleDispatch (/packages/real-time/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/packages/real-time/node_modules/event-kit/lib/emitter.js:141:28)
    at PeerPool.didReceiveMessage (/packages/real-time/node_modules/@atom/real-time-client/lib/peer-pool.js:90:18)
    at PeerConnection.finishReceiving (/packages/real-time/node_modules/@atom/real-time-client/lib/peer-connection.js:201:10)
    at PeerConnection.receive (/packages/real-time/node_modules/@atom/real-time-client/lib/peer-connection.js:192:14)
    at RTCDataChannel.channel.onmessage (/packages/real-time/node_modules/@atom/real-time-client/lib/peer-connection.js:105:47)

Commands

  3x -7:29.3.0 core:move-down (input.hidden-input)
  4x -7:28.4.0 editor:newline (input.hidden-input)
     -5:04.8.0 tabs:split-right (div.title)
     -2:59.4.0 command-palette:toggle (div.package-detail.panels-item)
     -2:58.1.0 core:confirm (input.hidden-input)
     -2:58.1.0 real-time:join-portal (div.package-detail.panels-item)
     -2:57.7.0 core:paste (input.hidden-input)
     -2:56.9.0 core:undo (input.hidden-input)
     -2:53.7.0 core:confirm (input.hidden-input)
     -2:11.3.0 command-palette:toggle (div.package-detail.panels-item)
     -2:10.5.0 core:confirm (input.hidden-input)
     -2:10.5.0 real-time:join-portal (div.package-detail.panels-item)
     -2:05.3.0 command-palette:toggle (div.package-detail.panels-item)
     -2:04.8.0 core:confirm (input.hidden-input)
     -2:04.8.0 real-time:join-portal (div.package-detail.panels-item)
     -2:04.0 core:confirm (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.6 
atom-beautify 0.30.5 
atom-dark-fusion-syntax 2.2.0 
atom-ide-ui 0.1.11 
atom-material-syntax 1.0.6 
atom-material-ui undefined 
autocomplete-emojis 2.5.0 
busy-signal 1.4.3 
chester-atom-syntax 0.3.0 
chestnut-light-atom-syntax 0.2.1 
color-picker 2.2.5 
editor-stats 0.17.0 
fizzy 0.21.0 
golden-ratio 0.3.0 
hey-pane 1.0.0 
highlight-selected 0.13.1 
honor-altgraph 0.1.0 
intentions 1.1.5 
language-latex 1.1.1 
language-markdown 0.25.1 
latex 0.46.0 
less-than-slash 0.17.0 
linter 2.2.0 
linter-js-standard 4.0.0 
linter-ui-default 1.6.8 
markdown-pdf 1.5.4 
minimap 4.29.6 
minimap-autohider 1.5.3 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
nebula-syntax 0.4.4 
nebula-ui 0.6.0 
no-caffeine-syntax 0.18.1 
nucleus-dark-ui 0.12.3 
pastel-jelly-syntax 0.2.0 
php-cs-fixer 4.1.0 
pigments 0.40.2 
platformio-ide-terminal 2.5.5 
preview-inline 1.4.7 
real-time 0.1.0 
remote-edit 1.9.0 
seti-syntax 1.1.3 
seti-ui 1.9.0 
Sublime-Style-Column-Selection 1.7.4 
tab-title 0.3.5 
toggler 0.3.0 
vim-mode-plus 1.3.3 
zentabs 0.8.8 
Ben3eeE commented 7 years ago

Here is a handy gif of a local repro that portal thing

as-cii commented 7 years ago

@jasonrudolph and I tried to reproduce this locally but were unable to. master has changed quite significantly over the last 24 hours, so it's possible that this issue has been resolved.

Can you pull the latest version and try again? In the meantime we're gonna close this, but feel free to re-open in case you can still reproduce after upgrading.

Ben3eeE commented 7 years ago

I tried this on latest master and it reconnects fine but I get an error in the developer tools console of the guest for the first reconnect. After closing the host a few times the guest window never seems to reconnect to the new host window and just fails silently (With an error in the developer tools console).

First reconnect:

Uncaught (in promise) DOMException: Failed to set remote answer sdp: Called in wrong state: STATE_INIT
receiveMessage @ I:\atom_master\real-time\node_modules\@atom\real-time-client\lib\pub-sub-signaling-provider.js:40

Second reconnect (Note that the DOMException appears twice on the second reconnect so there are 3 in total in the console):

Uncaught (in promise) DOMException: Failed to set remote answer sdp: Called in wrong state: STATE_INIT
receiveMessage @ I:\atom_master\real-time\node_modules\@atom\real-time-client\lib\pub-sub-signaling-provider.js:40
I:\atom_master\real-time\node_modules\@atom\real-time-client\lib\pub-sub-signaling-provider.js:40 Uncaught (in promise) DOMException: Failed to set remote answer sdp: Called in wrong state: STATE_INIT
receiveMessage @ I:\atom_master\real-time\node_modules\@atom\real-time-client\lib\pub-sub-signaling-provider.js:40
Uncaught (in promise) TypeError: Cannot read property 'PortalNotFoundError' of undefined
    at GuestPortalBinding.didFailToJoin (I:\atom_master\real-time\lib\guest-portal-binding.js:99)
    at GuestPortalBinding.initialize (I:\atom_master\real-time\lib\guest-portal-binding.js:32)
didFailToJoin @ I:\atom_master\real-time\lib\guest-portal-binding.js:99
initialize @ I:\atom_master\real-time\lib\guest-portal-binding.js:32

stdout has a lot of messages like this:

[8824:0920/165216.219:ERROR:stunport.cc(89)] Binding request timed out from 192.168.148.x:50282 ({3731940F-583B-45E5-B43B-066B1E3486D8})
[9576:0920/165443.247:ERROR:stunport.cc(89)] Binding request timed out from 192.168.200.x:59032 ({9FB3A088-6FD0-4FA9-B824-8615671FF1F2})
[9576:0920/165443.247:ERROR:stunport.cc(89)] Binding request timed out from 192.168.148.x:59034 ({3731940F-583B-45E5-B43B-066B1E3486D8})
[9576:0920/165443.336:ERROR:stunport.cc(89)] Binding request timed out from 192.168.200.x:59032 ({9FB3A088-6FD0-4FA9-B824-8615671FF1F2})
[9576:0920/165443.336:ERROR:stunport.cc(89)] Binding request timed out from 192.168.148.x:59034 ({3731940F-583B-45E5-B43B-066B1E3486D8})
nathansobo commented 7 years ago

Should we reopen?

Ben3eeE commented 7 years ago

I think so. I don't have access to do it.

as-cii commented 7 years ago

@nathansobo and I tried again but it seems to work okay on macOS, so we wonder if this may be a platform-specific issue. @ungb: can you help us track this down and maybe test it on Windows as well? 🙇

ungb commented 7 years ago

Yup I believe this is windows only as when we were testing it was occurring on windows for @Ben3eeE but me and Robert didn't see any issues.

Ben3eeE commented 7 years ago

Yeah. I had this issue several times when we were testing. And this also reproduces every time for me. It's either windows only or something with my computer.

I can test on another Windows machine if Bryant can't reproduce on Windows.

jasonrudolph commented 7 years ago

I tried to reproduce this on Windows, but I couldn't reproduce it. @Ben3eeE: Can you confirm that these are the right steps needed to reproduce this issue?

  1. Open Atom window on right. (This will be the host.)
  2. Open Atom window on left. (This will be the guest.)
  3. In host window, share portal.
  4. In guest window, join portal.
  5. Close host window.
  6. Open new Atom window on right. (This will be the new host.)
  7. In host window, share portal.
  8. In guest window, join portal.

Demo

demo

Version Info

I'm using the real-time package at 6b54ed77ccca95d52c717115c5d2061d04882c37.

Other version info:

C:\Users\j\Documents\GitHub\real-time>atom --version

Atom    : 1.21.0-beta1
Electron: 1.6.9
Chrome  : 56.0.2924.87
Node    : 7.4.0

C:\Users\j\Documents\GitHub\real-time>apm --version
apm  1.18.5
npm  3.10.10
node 6.9.5 x64
python
git
visual studio
Ben3eeE commented 7 years ago

Log of slack PM with @jasonrudolph regarding ☝️

@Ben3eeE Differences: I am using master Atom at a3e98d54e I am launching Atom in dev mode from Windows powershell during all steps. You launch the new window using the file menu.

@jasonrudolph Can you try to reproduce by launching Atom windows from the file menu?

@Ben3eeE Does not reproduce Does not reproduce when using the powershell either now Seems to not happen every time But once it happens it happens every time until you close out Atom I did it 4 times to reproduce now One from the file menu and 3 from powershell [10884:0920/230111.326:ERROR:stunport.cc(283)] Jingle:Port[000001ADD5E4A680:data:1:0:local:Net[{498322FA-74D2-494B-AD86-B5C484CE6F05}:192.168.1.x/24:Ethernet]]: UDP send of 100 bytes failed with error 10053 [10884:0920/230133.821:ERROR:stunport.cc(89)] Binding request timed out from 192.168.200.x:56302 ({9FB3A088-6FD0-4FA9-B824-8615671FF1F2}) Also failed to send TURN message also err=10053 Is what I get in stdout

@jasonrudolph Gotcha. Thanks. Would you mind updating the issue to include that info? :bow:

jasonrudolph commented 7 years ago

FYI: We (@as-cii and I) are working on https://github.com/atom/real-time/issues/81, and we think there's a good chance that the solution to https://github.com/atom/real-time/issues/81 will resolve this issue.

Ben3eeE commented 7 years ago

Awesome. Looking forward to seeing this fixed. I saw it two times yesterday when pairing with Bryant. I had to restart Atom to reconnect after being disconnected.

jasonrudolph commented 7 years ago

@Ben3eeE: We think this is resolved as of a4dff286a42cc11dea3e1f2d11e819513b4ca6e2. If you continue to see this issue, please let us know. :bow:

Ben3eeE commented 7 years ago

@jasonrudolph I can no longer reproduce this.

I can reproduce getting connection errors displayed in the UI when doing the same steps but attempting to reconnect worked every time instead of throwing exceptions or failing silently in the developer tools console.

jasonrudolph commented 7 years ago

@Ben3eeE: Thanks for following up. :bow:

I can reproduce getting connection errors displayed in the UI when doing the same steps

How often are you able to reproduce that issue? Can you tell us what error message you see when that issue occurs?

Ben3eeE commented 7 years ago

@jasonrudolph I'd say it's like every 5th reconnect. I have never seen it on the first connect. The error is the same as the one in image in the body of the issue Failed to execute 'send' on RTCDataChannel: could not send data.

Previously when trying to reconnect after seeing this error I would get exceptions and have to restart Atom to reconnect. But now it works fine to just try again.

I can test it out more and provide more accurate data later if you want :zap: It would be interesting to try it out when pairing with someone else again because that's when I had the most issues and had to restart Atom often. So it might be worse xos. Or it might be because it was before these fixes.

Do you have any idea about what is going wrong when you see this error message?

/cc: @ungb Do you have some time to pair again this week? I have some other tests I want to do as well that I mentioned to you earlier.

as-cii commented 7 years ago

Do you have any idea about what is going wrong when you see this error message?

One hypothesis might be that Chromium notifies the real-time package that the connection was closed after trying to reconnect, which means that the package may be attempting to re-use an existing connection that has already been closed.

We are still unable to reproduce this locally, but we think it's an important issue to resolve. We're hoping that as you and @ungb continue 🍐ing, some consistent reproduction steps will reveal themselves so that we can address it.

Thanks again for the bug report, @Ben3eeE! ⚡️

robjac commented 6 years ago

I realize this is closed; but should it be? Just got the error this morning on OSX.

[Enter steps to reproduce:]

  1. try to join a colleagues portal
  2. bombs out immediately after click.

first attempt error: Attempting to join portal failed with error: ref2.file.onDidChange is not a function

Atom: 1.26.1 x64 Electron: 1.7.11 OS: Mac OS X 10.13.4 Thrown From: teletype package 0.13.1

Stack Trace

Uncaught TypeError: this.resolveConnectionPromise is not a function

At /Users/robjac/.atom/packages/teletype/node_modules/@atom/teletype-client/lib/star-overlay-network.js:257

TypeError: this.resolveConnectionPromise is not a function
    at StarOverlayNetwork.receiveJoinResponse (/packages/teletype/node_modules/@atom/teletype-client/lib/star-overlay-network.js:257:10)
    at StarOverlayNetwork.receive (/packages/teletype/node_modules/@atom/teletype-client/lib/star-overlay-network.js:203:12)
    at Function.module.exports.Emitter.simpleDispatch (/packages/teletype/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/packages/teletype/node_modules/event-kit/lib/emitter.js:141:28)
    at PeerPool.didReceiveMessage (/packages/teletype/node_modules/@atom/teletype-client/lib/peer-pool.js:161:18)
    at PeerConnection.finishReceiving (/packages/teletype/node_modules/@atom/teletype-client/lib/peer-connection.js:276:10)
    at PeerConnection.receive (/packages/teletype/node_modules/@atom/teletype-client/lib/peer-connection.js:267:14)
    at RTCDataChannel.channel.onmessage (/packages/teletype/node_modules/@atom/teletype-client/lib/peer-connection.js:135:47)

Commands

  2x -2:55.8.0 core:paste (input.hidden-input)
     -0:25.2.0 deprecation-cop:view (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-neon-color-scheme.theme-pristine-ui.teletype-Authenticated)
     -0:19.2.0 core:paste (input.hidden-input)
     -0:18.2.0 core:select-all (input.hidden-input)
     -0:17.8.0 core:backspace (input.hidden-input)
     -0:13.1.0 core:paste (input.hidden-input)

Non-Core Packages

accents-ui 1.3.0 
adventurous-syntax 0.2.0 
aesthetic-ui 4.0.0 
an-old-hope-syntax 1.0.4 
angularjs 0.5.3 
animated-cursor 1.1.0 
apex-ui 1.2.0 
atom-beautify 0.32.2 
atom-bulma 0.7.1 
atom-clock 0.1.16 
atom-gooey-syntax 1.0.0 
atom-handlebars 1.3.0 
atom-ide-ui 0.11.1 
atom-jshint 2.0.0 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-monokai 0.10.9 
atom-monokai-dark 0.4.0 
atom-pair 2.0.13 
atom-solarized-dark-ui 0.28.1 
atom-sonic 0.3.2 
atom-sonic-pi 0.1.0 
atom-tachyons 1.6.0 
atom-ternjs 0.18.3 
atom-toolbar 0.1.6 
atom-visual-studio-code-ui 1.3.4 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
autocomplete 0.47.0 
autocomplete-clang 0.11.4 
autocomplete-elixir 1.5.16 
autocomplete-erlang 1.1.2 
autocomplete-glsl 0.2.3 
autocomplete-haskell 1.0.1 
autocomplete-java 1.2.7 
autocomplete-json 5.5.2 
autocomplete-php 0.3.7 
autocomplete-ruby 0.2.8 
autocomplete-ruby-rct 0.1.0 
autoprefixer 3.7.1 
base16-eighties-dark 2.1.1 
brogrammer-syntax 1.0.0 
brogrammer-ui 1.0.0 
browser-plus 0.0.98 
browser-plus-open-new-window 0.0.1 
browser-plus-zoom 0.0.2 
busy-signal 1.4.3 
chameleon-dark-syntax 0.0.5 
city-lights-icons 1.1.1 
city-lights-syntax 1.1.8 
city-lights-ui 1.3.3 
cobalt2-syntax 0.5.3 
color-picker 2.3.0 
custom-folds 1.9.5 
dark-bint-syntax 0.10.0 
dash 1.7.1 
double-tag 1.2.1 
dracula-syntax 2.0.6 
dracula-ui 0.6.0 
elm-format 3.0.0 
elm-instant 2.0.0 
elm-navigator 2.0.0 
elm-snippets 0.1.0 
elmjutsu 8.1.0 
ember-cli-helper 0.17.1 
emmet 2.4.3 
emmet-snippets-compatibility 1.0.6 
enhanced-tabs 1.7.0 
eval-javascript 1.2.0 
Extempore-Atom 0.3.2 
file-icons 2.1.19 
file-watcher 1.2.6 
flex-tool-bar 2.0.2 
floobits 0.32.12 
flow-ide 1.11.0 
font-awesome-snippetset 0.0.6 
fonts 3.0.3 
gibber 0.1.3 
git-status 0.3.4 
git-time-machine 1.5.9 
gl-light-syntax 3.0.0 
gruvbox-plus-syntax 1.3.1 
haskell-ghc-mod 2.2.3 
hey-pane 1.1.0 
highlight-column 0.5.4 
highlight-line 0.12.0 
highlight-selected 0.13.1 
html-to-elm 0.2.0 
hugs-syntax 1.0.0 
hyperclick 0.1.5 
ide-crystal 0.3.3 
ide-css 0.3.0 
ide-haskell 2.3.1 
ide-haskell-cabal 2.2.0 
ide-haskell-hasktags 0.0.15 
ide-haskell-repl 0.8.0 
ide-html 0.4.2 
ide-json 0.2.1 
incremental-search 5.2.2 
intentions 1.1.5 
javascript-snippets 1.2.1 
jQuery 1.2.6 
jquery-snippets 11.0.0 
jslint 1.5.1 
jumpy 4.2.0 
KeyCount 0.2.0 
language-babel 2.84.0 
language-crystal-actual 0.37.2 
language-elixir 0.22.0 
language-elm 1.5.0 
language-glsl 2.0.4 
language-graphql 0.10.1 
language-haml 0.31.0 
language-haskell 1.17.6 
language-ini 1.19.0 
language-kotlin 0.5.0 
language-lua 0.9.11 
language-ocaml 1.9.5 
language-rust 0.4.12 
language-scala 1.1.9 
language-supercollider 0.2.1 
language-swift 0.5.0 
language-thrift 1.0.2 
line-count 0.5.0 
line-diff-details 1.9.0 
linter 2.2.0 
linter-bootlint 1.1.0 
linter-clang 4.1.2 
linter-csslint 2.0.0 
linter-elixirc 1.7.0 
linter-elm-make 0.28.3 
linter-erb 1.1.0 
linter-eslint 8.4.1 
linter-glsl 2.1.4 
linter-hlint 2.0.0 
linter-htmlhint 1.4.0 
linter-mixed-indent 1.1.1 
linter-rails-best-practices 0.2.2 
linter-rubocop 2.2.3 
linter-ruby 1.2.6 
linter-rust 0.8.5 
linter-sass-lint 1.8.3 
linter-scss-lint 3.1.1 
linter-stylelint 4.2.0 
linter-tidy 2.3.1 
linter-ui-default 1.7.1 
linter-xo 0.25.0 
Lucario 2.2.0 
lunar-particle-syntax 0.3.8 
lunar-particle-ui 0.3.13 
material-design-syntax 3.1.2 
miami-nights-syntax 0.3.3 
minimap 4.29.8 
minimap-autohider 1.5.4 
minimap-bookmarks 0.4.2 
minimap-codeglance 0.4.7 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
minimap-linter 2.1.3 
minimap-pigments 0.2.2 
minimap-selection 4.5.0 
monokai 0.24.0 
monokai-blackboard 0.3.0 
monokai-dark 1.5.0 
monokai-flat 1.0.1 
monokai-seti 0.9.0 
motepair 0.24.0 
motepair2 0.37.0 
multi-cursor 2.1.5 
neon-color-scheme 1.0.0 
neon-syntax 0.3.7 
nova-atom-syntax 1.5.0 
nova-atom-ui 1.3.0 
nucleus-dark-ui 0.12.3 
nuclide 0.299.0 
nuclide-format-js 0.0.45 
oceanic-next 1.0.0 
oceanic-reef-syntax 0.9.0 
octocat-syntax 2.2.1 
open-recent 5.0.0 
p5xjs-autocomplete 2.3.0 
package-cop 0.2.10 
package-list 0.1.2 
package-switch 0.5.0 
package-sync 1.1.0 
pane-layout-plus 0.7.4 
pigments 0.40.2 
platformio-ide-terminal 2.8.1 
predawn-syntax 1.0.4 
predawn-ui 1.0.7 
prettier-atom 0.53.0 
pristine-ui 1.1.11 
project-colorize 0.3.0 
project-manager 3.3.5 
project-sidebar 1.3.0 
project-view 0.6.2 
pure-syntax 0.3.0 
rails-finder 0.10.0 
rails-snippets 2.18.0 
rails-transporter 1.7.1 
react 0.18.0 
react-es6-snippets 0.3.0 
react-native-snippets 0.3.0 
react-snippets 1.1.0 
recent-projects 0.13.1 
relative-numbers 0.9.0 
robin-hood-syntax 1.0.0 
rubocop-auto-correct 1.5.1 
ruby-solargraph 0.2.0 
script 3.17.3 
scss-media-queries 0.4.0 
scss-snippets 0.6.0 
selector-to-tag 0.4.4 
set-syntax 0.4.0 
seti-syntax 1.1.3 
seti-ui 1.10.0 
seti-ui-red 0.13.0 
SkriptDark-Neon-Syntax 2.1.2 
sort-lines 0.18.0 
spacegray-dark-syntax 0.2.0 
standard-formatter 2.8.0 
standardjs-snippets 2.6.2 
steam-pirate-syntax 0.3.0 
steam-pirate-ui 0.6.1 
Sublime-Style-Column-Selection 1.7.4 
supercollider 0.9.1 
supercopair 0.10.7 
sync-settings 0.8.6 
tab-smart-sort 0.3.0 
teletype 0.13.1 
terminal-syntax 0.1.0 
terminate-syntax 0.3.0 
tidal-autocode 0.6.4 
tidalcycles 0.12.1 
todo-show 2.3.0 
tomorrow 1.0.0 
tomorrow-night-eighties 0.5.0 
tomorrow-night-eighties-syntax 1.0.2 
tool-bar 1.1.7 
tool-bar-almighty 0.8.2 
tree-view-git-status 1.5.0 
ubik-hackerman-syntax 1.10.0 
veda 2.9.0 
vim-mode-plus 1.32.0 
vim-mode-plus-keymaps-for-surround 0.2.1 
zentabs 0.8.9 
jasonrudolph commented 6 years ago

@robjac: Thanks for letting us know about the problem you encountered. Would you mind opening a new issue?

robjac commented 6 years ago

Sure thing

jasonrudolph commented 6 years ago

I realize this is closed; but should it be? Just got the error this morning on OSX.

Thanks to @robjac for opening https://github.com/atom/teletype/issues/369 to track the most recent incarnation of the "this.resolveConnectionPromise is not a function" problem.