-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send nr version #327
Send nr version #327
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ben, I can see a few other places in the code base where getAgent
is called but without the async. And where they are, they have sync function signatures meaning the proliferation of the async
await
stuff has tentacles that reach even further out & I am unsure of the sideeffects in production.
TBH, I would be tempted to undo all of this and simply modify launcher.readPackage()
to use readFileSync
from fs
.
There are only around ~5 calls to readPackage
that would simply need to lose the await
- then there would be no need to make getState
async and no need to follow its code branches and parent callers adding await to everything it touches.
Co-authored-by: Stephen McLaughlin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, much cleaner without all the proliferating async await.
However, there is an issue with module
vs modules
and a couple of suggestions.
Lastly, do we thing a unit test is possible?
there is already tests in test/unit/lib/agent_spec.js
around line 493 for getState
- even just the presence of the property being a valid semver
Co-authored-by: Stephen McLaughlin <[email protected]>
I don't see how without having the test actually install Node-RED. I already had to patch the code because the tests are injecting a JSON object rather than a real launcher object |
Fair enough Ben - just thought to ask. |
can we look at using Without this, I can foresee a future ticket where the |
Description
Has the the device agent report the currently running Node-RED version as part of it's regular check-in
This for use with the Device Editor Proxy.
Related Issue(s)
FlowFuse/flowfuse#3414
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label