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

[jsscripting] addon uninstallation issues #11220

Closed
ssalonen opened this issue Sep 8, 2021 · 4 comments
Closed

[jsscripting] addon uninstallation issues #11220

ssalonen opened this issue Sep 8, 2021 · 4 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@ssalonen
Copy link
Contributor

ssalonen commented Sep 8, 2021

I have noticed that jsscripting addon uninstallation has unexpected behaviour.

Also discussed in community forums: https://community.openhab.org/t/all-my-ecmascript-scripts-stopped-working-throwing-exceptions/125341/8

Expected Behavior

Uninstallation of the jsscripting bundle should make future executions of javascript scripts/rules to use the default javascript engine immediately.

Current Behavior

Restart is needed after addon uninstallation to ensure that all scripts/rules use the default engine.

Steps to Reproduce (for Bugs)

  1. Follow steps 1-14 in [jsscripting] jsscripting automation bundle installation issues #11219
  2. Uninstall the bundle
  3. Execute the oldscript script. Observe that we still get the error from the new script engine (org.graalvm.polyglot.PolyglotException: ReferenceError: "itemRegistry" is not defined), even after the addon has been uninstalled
  4. Restart openHAB, and re-execute the oldscript script. One can see that script executes without an error, using the default javascript engine.

Context

Trying to migrate to ES6 in rules/scripts.

Your Environment

  • Version used: (e.g., openHAB and add-on versions)
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...):
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...):

I can reproduce with 3.2.0 M2. Probably present with 3.1.0 as well, but have not tried.

Linux  5.13.13-200.fc34.x86_64 #1 SMP Thu Aug 26 17:06:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
@ssalonen ssalonen added the bug An unexpected problem or unintended behavior of an add-on label Sep 8, 2021
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/all-my-ecmascript-scripts-stopped-working-throwing-exceptions/125341/10

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/usage-of-new-ecma2021-automation-scripting-graalvm/122724/24

@florian-h05
Copy link
Contributor

Uninstallation of the jsscripting bundle should make future executions of javascript scripts/rules to use the default javascript engine immediately.

As JS Scripting is now using its own mime type, this cannot be accomplished. Therefore this issue is outdated.

@florian-h05 florian-h05 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
@florian-h05
Copy link
Contributor

Furthermore, the behaviour that a UI script of one engine can still be run after the engine has been uninstalled (not sure if this the same now or it has changed) is related to core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

3 participants