             port: payload.port
         sendExportedPorts connection, runtime
         # For subscribing to output packets
-        runtime.exportedEdges = [] if not runtime.exportedEdges?
         runtime.exportedEdges.push
             src:
                 process: payload.node

    else if command is "edges"
        # TOD: merge with those of exported outports
        runtime.edgesForInspection = payload.edges
        runtime.exportedEdges = [] if not runtime.exportedEdges?
        edges = runtime.edgesForInspection.concat runtime.exportedEdges
        handleNetworkEdges runtime, connection, edges
        sendAck connection, { protocol: 'network', command: command, payload: payload }

    runtime.device.sendCommands data, (err) ->
        # Subscribe to change notifications
        # TODO: use a dedicated mechanism for this based on subgraphs
        edges = runtime.exportedEdges.concat runtime.edgesForInspection
        handleNetworkEdges runtime, connection, edges, (err) ->
            runtime.uploadInProgress = false

