noflo / noflo-ui

NoFlo Development Environment
https://app.flowhub.io
MIT License
768 stars 173 forks source link

Fails on 'edit as project' when runtime has no main graph #728

Closed jonnor closed 7 years ago

jonnor commented 7 years ago

To reproduce:

Expected: Can edit program Actual:

I was unable to debug the issue, as the exception is not thrown and catchable in debugger, and the stack logged only refers to the minified source.

On live Flowhub, v0.19.5. MicroFlo 0.3.54

jonnor commented 7 years ago

Building locally and replacing the minified include with the proper, I got a usable stacktrace:

TypeError: Cannot read property 'type' of undefined
  at getGraphType (http://localhost:9999/browser/noflo-ui.js:47189:36)
  at Component.<anonymous> (http://localhost:9999/browser/noflo-ui.js:47262:17)
  at task (http://localhost:9999/browser/noflo-ui.js:91228:22)
  at resumeTaskQ (http://localhost:9999/browser/noflo-ui.js:90858:25)
  at InPort.inPort.process (http://localhost:9999/browser/noflo-ui.js:91233:13)
  at InPort.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:29932:16)
  at InternalSocket.<anonymous> (http://localhost:9999/browser/noflo-ui.js:29860:24)
  at InternalSocket.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2457:20)
  at InternalSocket.debugEmitEvent (http://localhost:9999/browser/noflo-ui.js:14050:21)
  at InternalSocket.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:14232:19)
  at InternalSocket.send (http://localhost:9999/browser/noflo-ui.js:14095:19)
  at http://localhost:9999/browser/noflo-ui.js:30122:23
  at Array.forEach (native)
  at OutPort.send (http://localhost:9999/browser/noflo-ui.js:30118:22)
  at InPort.<anonymous> (http://localhost:9999/browser/noflo-ui.js:51795:35)
  at InPort.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2442:17)
  at InPort.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:29938:19)
  at InternalSocket.<anonymous> (http://localhost:9999/browser/noflo-ui.js:29860:24)
  at InternalSocket.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2457:20)
  at InternalSocket.debugEmitEvent (http://localhost:9999/browser/noflo-ui.js:14050:21)
  at InternalSocket.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:14232:19)
  at InternalSocket.send (http://localhost:9999/browser/noflo-ui.js:14095:19)
  at http://localhost:9999/browser/noflo-ui.js:30122:23
  at Array.forEach (native)
  at OutPort.send (http://localhost:9999/browser/noflo-ui.js:30118:22)
  at Component.<anonymous> (http://localhost:9999/browser/noflo-ui.js:48491:20)
  at task (http://localhost:9999/browser/noflo-ui.js:91228:22)
  at resumeTaskQ (http://localhost:9999/browser/noflo-ui.js:90858:25)
  at InPort.inPort.process (http://localhost:9999/browser/noflo-ui.js:90899:16)
  at InPort.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:29932:16)
  at InternalSocket.<anonymous> (http://localhost:9999/browser/noflo-ui.js:29860:24)
  at InternalSocket.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2457:20)
  at InternalSocket.debugEmitEvent (http://localhost:9999/browser/noflo-ui.js:14050:21)
  at InternalSocket.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:14232:19)
  at InternalSocket.send (http://localhost:9999/browser/noflo-ui.js:14095:19)
  at http://localhost:9999/browser/noflo-ui.js:30122:23
  at Array.forEach (native)
  at OutPort.send (http://localhost:9999/browser/noflo-ui.js:30118:22)
  at InPort.process (http://localhost:9999/browser/noflo-ui.js:47405:27)
  at InPort.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:29932:16)
  at InternalSocket.<anonymous> (http://localhost:9999/browser/noflo-ui.js:29860:24)
  at InternalSocket.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2457:20)
  at InternalSocket.debugEmitEvent (http://localhost:9999/browser/noflo-ui.js:14050:21)
  at InternalSocket.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:14232:19)
  at InternalSocket.send (http://localhost:9999/browser/noflo-ui.js:14095:19)
  at InternalSocket.<anonymous> (http://localhost:9999/browser/noflo-ui.js:18768:25)
  at InternalSocket.g (http://localhost:9999/browser/noflo-ui.js:2526:16)
  at InternalSocket.EventEmitter.emit (http://localhost:9999/browser/noflo-ui.js:2457:20)
  at InternalSocket.debugEmitEvent (http://localhost:9999/browser/noflo-ui.js:14050:21)
  at InternalSocket.handleSocketEvent (http://localhost:9999/browser/noflo-ui.js:14232:19)
  at InternalSocket.connect (http://localhost:9999/browser/noflo-ui.js:14080:19)
  at http://localhost:9999/browser/noflo-ui.js:18770:23
  at Array.forEach (native)
  at Port.send (http://localhost:9999/browser/noflo-ui.js:18763:27)
  at IDBTransaction.<anonymous> (http://localhost:9999/browser/noflo-ui.js:52848:35)
jonnor commented 7 years ago

Graph does not have .properties.environment flowhub-missing-environment

jonnor commented 7 years ago

Seemingly this only happens if the runtime connection does not have a main graph (returned by getruntime). Since this is optional in the protocol, should also handle this case.