[Bug Report] GEDI not updating #uses

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
7 posts • Page 1 of 1
elvir.brkic@bstelecom.ba
Posts:7
Joined: Thu Apr 03, 2014 12:16 pm

[Bug Report] GEDI not updating #uses

Post by elvir.brkic@bstelecom.ba »

There is a bug in version 3.14 (P004) with following symptoms.

Prerequisites:
We need two libraries that contain function with same name, and another script that is calling that function. In included example there is lib_a.ctl, lib_b.ctl and test panel that is calling function on click. https://www.winccoa.com/fileadmin/image ... es_bug.zip

Symptoms:
1. First issue is that panel will not call function from library selected with #uses, but will use wrong library.
Steps to reproduce:
a. Edit panel script to use lib_a.ctl
b. Restart GEDI
c. Run panel in QuickTest and panel will call function from lib_a.ctl which is OK.
d. Now edit panel to use lib_b.ctl instead, and run in QuickTest. Panel will call function from lib_b.ctl which is also OK.
e. Edit panel again to use lib_a.ctl and run QuickTest. Panel will call function from lib_b.ctl, which is NOT OK.
It is necessary to restart GEDI again i order for it to work properly. This is not specific only to GEDI, we can use any other panel as parent that would open test panel as a child.
So basically, we can only change library once, and than we are stuck until parent panel is restarted.

2. Second issue is cosmetic but is causing confusion, because tool-tip for function will remember only one library as location of function (where "Jump to function" points to), and will not update if we use #uses to switch to different library even after GEDI restart.
Image
Attachments
uses_bug.zip
(850 Bytes) Downloaded 132 times
uses.png

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: [Bug Report] GEDI not updating #uses

Post by leoknipp »

I do not see this as a bug.
Once a library is loaded in a manager it remains loaded until the manager is stopped. Only closing a panel where #uses was used does not unload the libraries.

Using the same function names in different libraries might not only be a problem during runtime if a manager loads both libraries. Also debugging the code or trying to find an error will be more difficult if you do not know exactly which libraries have been loaded at the time when the error occured.

Please use unique function names to avoid these problems.

Best Regards
Leopold Knipp
Senior Support Specialist

elvir.brkic@bstelecom.ba
Posts:7
Joined: Thu Apr 03, 2014 12:16 pm

Re: [Bug Report] GEDI not updating #uses

Post by elvir.brkic@bstelecom.ba »

What I see as a "bug" is inconsistent behavior between 1.d. and 1.e.
If we load libA during startup, why would it allow us to switch to libB during runtime, and not allow us to switch back to libA?

Also, there is still issue 2. which can not be resolved with GEDI restart.

In the end we started using unique names, but it feels more like workaround because it defeats purpose of #uses.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: [Bug Report] GEDI not updating #uses

Post by leoknipp »

if a library is already loaded it is not loaded again. Therefore the functions are not replaced in your example by those defined in iibA when using #uses again.
If several libraries contain functions with same names those are used which have been loaded last.

The GEDI is searching in all libraries for matching functions, independent of the fact if the library is loaded (during startup or with the #uses keyword) or not.

Best Regards
Leopold Knipp
Senior Support Specialist

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: [Bug Report] GEDI not updating #uses

Post by mkoller »

"The GEDI is searching in all libraries for matching functions, independent of the fact if the library is loaded (during startup or with the #uses keyword) or not."

To be exact, the script editor loads all libraries to know which functions are existing in which libs.
However, the script editor does currently not deal with duplicate function names. It stores all names in a hash and only the last one inserted is known.
Call it limitation or bug ...

However, note that the UI and CTRL manager CAN NOT USE duplicate functions in different libraries loaded at the same time.
Just the last one will be found.
That's neither a bug nor a limitation.
By defintion, all functions in all loaded libraries MUST BE UNIQUE.

#uses just tells the CTRL interpreter core which lib to load. It never unloads libs during runtime.

elvir.brkic@bstelecom.ba
Posts:7
Joined: Thu Apr 03, 2014 12:16 pm

Re: [Bug Report] GEDI not updating #uses

Post by elvir.brkic@bstelecom.ba »

We can call it "undocumented feature" for now :)
I must say I was not aware of this "By definition, all functions in all loaded libraries MUST BE UNIQUE" and I couldn't find it in help.
IMHO, it should be better documented, but it would be nice if script editor could perform some validity check (hash is already there :)).

I think that for me all of confusion was caused because keyword #uses is somewhat misleading. It just loads a library and has no effect on which library will be actually used by script.
Not that this will matter with unique names anyway.

Anyway, thank you Leopold and Martin for detailed explanation.

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: [Bug Report] GEDI not updating #uses

Post by Gertjan van Schijndel »

For the first issue (execution) you could try to use 'execScript' or 'evalScript' and include the '#uses' in the passed script.

7 posts • Page 1 of 1