FlowFuse / nr-project-nodes

A set of Node-RED nodes for inter-project communication within the FlowFuse platform
Apache License 2.0
5 stars 0 forks source link

Nodes appear in pallette of a CE licensed install #10

Closed sammachin closed 1 year ago

sammachin commented 1 year ago

Current Behavior

The Link Nodes appear in the pallette for projects using the new stack on a CE licensed platfrom.

This means that they can be added to the flow but when deployed this throws an error, because the node has not been registered in the runtime due to this check https://github.com/flowforge/flowforge-nr-project-nodes/blob/main/nodes/project-link.js#L4 The correct warning is shown in the node-red startup log: 09/08/2022 11:49:43 [warn] Project Link nodes require flowforge settings

However there is no such check to control the RED.nodes.registerType` call in the html file

The nodes themselves are not functional and you cannot get the list of projects

Expected Behavior

Nodes should not appear in the palette

Steps To Reproduce

Deploy a new project in a CE licensed platform,

Environment

knolleary commented 1 year ago

Ah I missed this in the review. The code you link to should be throwing an error, not just logging one. Otherwise the runtime doesn't know there's a problem and allows the HTML to still be loaded into the editor.

sammachin commented 1 year ago

Ah so if the js throws an error then that will prevent the html from being parsed?

knolleary commented 1 year ago

if the js throws an error then that will prevent the html from being parsed?

Correct