-
Problem report
-
Resolution: Unresolved
-
Trivial
-
6.4.19, 7.0.5
-
None
-
Sprint candidates
Steps to reproduce:
- Create host with trapper item
- Add javascript preprocessing: return "{$MACRO}"
- Add host macro {$MACRO} with value 1
- Start server
- Send value to item
- Check item value in latest data -> 1
- Update {$MACRO} value to 2
- Reload server configuration cache
- Send value to item
- Check item value in latest data
The item value is still 1 while it should be 2.
This happens because preprocessing caches the compiled bytecode and resets this cache only on item error or preprocessing change. Since macros are resolved directly in script code, the cached bytecode will have old macro values.
There are several ways to fix it.
1) scrap the bytecode caching. This will have some performance impact, but easy to implement and will not affect other preprocessing steps.
2) drop preprocessing cache during preprocessing configuration update if item has javascript preprocessing steps. This would affect other steps like 'change' or throttling'. For example change would be reset whenever host or linked template macro changes.