|
Malach Apprentice
Joined: 03 Nov 2007 Posts: 132
|
Posted: Fri May 09, 2008 5:41 pm
[2.25] Duplicate variables created when dragging classes between Packages |
Here are the steps to reliably reproduce this problem:
1. Open CMUD
2. Hit "ESC" from the "Sessions" window
3. Select "All Settings" from the "View" menu
4. Create a class titled "Class1"
6. In Class1 create a variable entitled "TestVar". Set the value to 0
7. In Class1 create an alias entitled "setvar" with a value of "TestVar = 1;#say @TestVar;TestVar = 2;#say @TestVar;TestVar = 0;#say @TestVar"
8. Type "setvar" on the command line a few times and look at the results. Everything should be fine.
9. Select "New Package" from the "File" menu
10. Title the Package "Package1"
11. Click and drag Class1 to Package1
12. Type "setvar" on the command line a few times. You should now see a duplicate "TestVar" variable in Class1.
This happens when I click and drag the classes or when I select the "move to" option in the drop
This ONLY happens with the Variable = Value syntax in my testing. Replace the values in the setvar alias with #VAR TestVar Value and you will not get a duplicate.
If you delete that variable and create it again, the problem seems to disappear.
This is a huge problem and is grandfathered somehow so even if you dragged your various classes into other packages prior to this version, you end up with duplicate variables and your settings reading the value of whichever ones in a random seeming pattern, making for a less than reliable experience.
I'm going to see if it happens in any other scenarios that don't involve dragging settings inside a class to another package. So far it doesn't happen in the following situations:
1. Dragging just the "TestVar" and "setvar" settings to another package
2. Dragging the "TestVar" and "setvar" between classes in the same package |
|
_________________ Intel Core2 Quad CPU @ 2.4 GHZ with Windows Vista Home Premium and 2 GB Ram |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue May 13, 2008 5:34 pm |
Confirmed. The problem seems to be that CMUD loses track of the dragged variable some how, so the scoping search for creating the new variable doesn't find it.
|
|
_________________ Asati di tempari! |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Thu May 15, 2008 9:23 am |
Wow.. I think this might actually be the cause of a really fatal bug with expression trigs that I've been trying to narrow down a bit before bugging. The trigs seem to 'lose sight' of the variables they are monitoring, and when they do this, all sorts of things happen, including freezes and hangs.
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed May 21, 2008 7:57 pm |
Thanks for the detailed procedure. I have added this to the critical bug list.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu May 29, 2008 9:22 pm |
Wow, excellent procedure and nasty bug. There was a remaining case where the internal hash table used to lookup settings was not getting updated with the new module pointer in the new package. So the hash table still pointed to the old class record in the old package, which no longer existed, so it created a new variable.
While dragging the class to the new package was an excellent way to reproduce the problem, the core bug was at a lower level and might have been appearing in other situations. I should have this fixed now in 2.26. Thanks again for the good report. |
|
|
|
Malach Apprentice
Joined: 03 Nov 2007 Posts: 132
|
Posted: Thu May 29, 2008 9:26 pm |
Yeah, I was seeing it happen randomly in other situations but could never pin it down. This was the only reproduceable way I could do it. Glad you found it!!! I thought I was going crazy with my random duplicate problems!
|
|
_________________ Intel Core2 Quad CPU @ 2.4 GHZ with Windows Vista Home Premium and 2 GB Ram |
|
|
|
|
|