Skip to content
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

Suggestion: Check syntax when datapoints are changed/moved/deleted. #416

Closed
aleks-83 opened this issue Oct 18, 2019 · 2 comments
Closed

Comments

@aleks-83
Copy link

Hi,

i have a suggestion for optimizing the javascript adapter.

Some of my scripts are not running all the time.
So when i move or delete a datapoint (maybe by uninstalling another adapter), my scripts doesn't recognize that the datapoint is gone.
Not before the script is started or triggered, there will be a error shown in the log.
I would like to prevent this behaviour.

So the soulution could be that the scripts are checked for bad syntax when a datapoint is moved/changed/deleted.
But maybe the javascript adapter won't recognize that there is a change at the datapoints.
So maybe there could be a handshake between Javascript adapter and ioBroker!?

Sorry, i am not a programmer, these are just my thoughts about a possible optimization.

@AlCalzone
Copy link
Collaborator

Let me get this straight... You don't want to see errors when starting scripts that don't work anymore?

Aside from that: Accessing non-existing data points is not easily detectable without running the code, since it is still valid syntax. Even if we add static checks if the getState methods and similar are called with valid data points (which is pretty hard to do on its own), that doesn't mean this feature will find all occurences.

I believe this is something that should be solved in the scripts themselves:
Start --> Check that all necessary states/objects exist --> log error, stop the script OR run the rest of the script

@GermanBluefox
Copy link
Contributor

UNable to implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants