Closed georgi-iovchev closed 2 weeks ago
Hi ! Thanks for the report indeed the run once section was not taking into account into the caching strategy making it see as the same in both cases, I've fixed it for the next version.
Nicolas
Thank you very much for the fast response :)
Describe the bug Value of a variable defined in run once section in one element override the value of variable with same name in other other element. Happens only if the main code part of the bindings of the elements are absolutely the same.
Simhub version 9.3.1, upgraded to 9.3.4 and the issue is there too
Third party plugins no
To Reproduce
A. In dashboard editor create new dashboard. Put two text items - (lets call them T1 and T2)
B. Set text binding for T1 - computed value use javascript
// Run once javascript section myvar = 1
// Javascript section return myvar
// Run once javascript section myvar = 2
// Javascript section return myvar
Expected behavior Expected result is the "1" "2", but I get "2" "2"
Screenshots
![image](https://github.com/SHWotever/SimHub/assets/23377650/05c16165-5308-46d0-9b93-cfec1c3e97e8)
Log files attached SimHub.txt
Additional context Note1 - in the preview during edit - the the expected result is correct for each element. Note2 - the issue happens only if the main code of the bindings is absolutely same. If i put for example some comment in the code one of the text bindings there is no problem. Note3 - The real use case (when i noticed the problem) was in my dashboard I have some sector related text fields and I wanted same code on all the sectors and just in the runonce section put variable for which sector that element is.