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

[Blockly] Adding a DateComparison block always adds the Nashorn JS code #2038

Closed
Dooleweerdt opened this issue Aug 23, 2023 · 1 comment · Fixed by #2040
Closed

[Blockly] Adding a DateComparison block always adds the Nashorn JS code #2038

Dooleweerdt opened this issue Aug 23, 2023 · 1 comment · Fixed by #2040
Labels
bug Something isn't working main ui Main UI

Comments

@Dooleweerdt
Copy link
Contributor

The problem

Adding a "Date comparison Between" block in Blockly will always add the Nashorn zdt comparison code to the generated script.
image

Expected behavior

The expectation is that it should add the GraalVM zdt comparison code, if GrallVM is selected as script type.
image

Steps to reproduce

  1. Add in the DateComparison Between block to an empty Blockly script
  2. Save the script
  3. Check the Code page, it will show the NasHorn zdt code.
  4. Running the script will then fail, as the zdt functions can't be found.

Your environment

runtimeInfo:
version: 4.0.2
buildString: Release Build
locale: da-DK
systemInfo:
configFolder: /etc/openhab
userdataFolder: /var/lib/openhab
logFolder: /var/log/openhab
javaVersion: 17.0.7
javaVendor: Raspbian
osName: Linux
osVersion: 6.1.21-v7+
osArchitecture: arm
availableProcessors: 4
freeMemory: 101884896
totalMemory: 324403200
startLevel: 100
bindings: null
clientInfo:
device:
ios: false
android: false
androidChrome: false
desktop: true
iphone: false
ipod: false
ipad: false
edge: false
ie: false
firefox: false
macos: false
windows: false
cordova: false
phonegap: false
electron: false
nwjs: false
webView: false
webview: false
standalone: false
pixelRatio: 1
prefersColorScheme: dark
isSecureContext: false
locationbarVisible: true
menubarVisible: true
navigator:
cookieEnabled: true
deviceMemory: N/A
hardwareConcurrency: 8
language: da-DK
languages:
- da-DK
- da
- en-US
- en
- de
onLine: true
platform: Linux x86_64
screen:
width: 1920
height: 1080
colorDepth: 24
support:
touch: false
pointerEvents: true
observer: true
passiveListener: true
gestures: false
intersectionObserver: true
themeOptions:
dark: dark
filled: true
pageTransitionAnimation: default
bars: light
homeNavbar: default
homeBackground: default
expandableCardAnimation: default
userAgent: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/116.0.0.0 Safari/537.36
timestamp: 2023-08-23T15:27:15.278Z

Browser console

Browser network traffic

Additional information

@Dooleweerdt
Copy link
Contributor Author

This apparently only fails executing if adding both a DataComparison and a DataComparison Between block in the same script :-)
The DataComparison Between block will add (and overwrite?) the Nashorn version of the zdtCompare function, even though the Data Comparison block needs the GrallVM version.

florian-h05 pushed a commit that referenced this issue Aug 26, 2023
Fixes #2038

Signed-off-by: Brian Dooleweerdt Rasmussen <brian.rasmussen80@gmail.com>
florian-h05 added a commit that referenced this issue Aug 29, 2023
Fixes #2038

Signed-off-by: Brian Dooleweerdt Rasmussen
<brian.rasmussen80@gmail.com>
stefan-hoehn pushed a commit to stefan-hoehn/openhab-webui that referenced this issue Sep 23, 2023
Fixes openhab#2038

Signed-off-by: Brian Dooleweerdt Rasmussen <brian.rasmussen80@gmail.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
1 participant