-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[items] ItemPersistence: Convert state to primitive type in persist
method
#339
[items] ItemPersistence: Convert state to primitive type in persist
method
#339
Conversation
…ve type This fixes an issue, where the asynchronous way persistence services store caused multithreaded access to the script's context. Signed-off-by: Florian Hotze <[email protected]>
…e JSDoc Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
@jlaur Can you please check if this fixes the issue? Run |
Sure. I'll have a look asap. Will need to figure out how to do this in Windows where I have my development installation. |
In case you can’t figure it out I can provide you the webpacked version of the library (this is a single file containing the „compiled“ library and dependency code) tomorrow so you can simply download it and put it into the node_modules folder. |
Thanks. I remembered that I have a (very old) WSL installation on my Windows machine, so I'm currently updating it and will see if I can install nodejs there. Will continue tomorrow and let you know. 🙂 |
That went smoother than expected (although technically it is now tomorrow 😉). I was able to install nodejs and npm after the upgrade, and your |
Thanks for the feedback, great! I will merge this PR now and try to have a look at persisting TimeSeries, however I suspect this might be tricky due to the asynchronous nature of persistence services persisting data - we have to avoid that persistence gets something that is referenced by the script context (I think so, to be honest I haven’t found docs wrt to this and therefore it’s more or less guessing from my side - but your error message and this fix clearly indicate that I’m right). |
This fixes an issue, where the asynchronous way persistence services store the passed in state causes a IllegalStateException by GraalJS, because multithreaded access to the script's context is not allowed.
See openhab/openhab-core#4268 (comment).