Superglobal Variable consistently inconsistent across instances


#1

Try saying that 5 times fast… LOL


I have three instances of webCoRE. One is working behind the scenes, another is mostly tiles, and a third is for clients and testing.

I have a piston behind the scenes that sets a global string variable, and it works perfectly… Yet, when I switch to my “Tiles” instance, the global variable displays an incorrect string. When I switch to the third instance, it appears correctly again. I tested going back and forth between all three instances many times, and the results were 100% consistent:

temp = InstanceA writes/sees it correctly
temp = InstanceB sees it incorrectly
temp = InstanceC sees it correctly


Just to clarify, during testing, no pistons are running & no variables are changing…
The returned data is different at the precise moment that I change instances.

temp


This is the first time I have noticed globals bouncing back and forth by simply changing instances. How is it possible that the exact same string appears differently, depending on which instance I am in?

It is extra peculiar because the :19 was yesterday’s data.

Has anyone noticed anything like this before, or have any ideas on troubleshooting?


SuperGlobal Variable Problem?
Sorry, not ready yet
Convert UTC / Epoch Time to Human Time
Global variable changes for no reason
#2

Interesting. I see both strings when I click on the appropriate Date in the IDE > My Location > Events > All:

I guess the million dollar question is, why are two instances reporting the correct value, and one instance reporting the oldValue??

…and perhaps more importantly, how can I correct this?


#3

Further testing shows that the ‘Console’ returns the same pattern.

temp

100% repeatable just by changing instances…


I am really hoping that this is not a sign of corruption…


#4

It’s not a bug…
It’s twilight zone…
na na na na…na na nana…:))))))


#5

Well, a new day has begun, and my Superglobal variable was automatically updated. Interestingly, it now appears correctly in all three instances. (it literally ‘fixed’ itself)

My hypothesis?
Even though Superglobals appears to be a single variable, I now suspect that there is actually one created for each instance. I probably had a hiccup yesterday, and only 2 of the 3 were written to.

Any devs, please correct me if my hunch is incorrect.


PS. I also learned that when updating Superglobals, if you try to write the exact same string on top of itself, webCoRE will not even attempt it, and the “text editing” event does not occur. This part should have been obvious… Like how the command “Turn on bulb” will be ignored if the bulb is already on,


#6

In the past 5 days, I have noticed twice where one instance was still showing oldValue, and my other two instances are showing the new value. It seems I cannot rely on all the superglobals to be properly updated.

I just now added a 250ms WAIT between writes to see if that helps in the future.

I will keep you posted.


#7

Well, two months later, and I can say with 100% certainty:
Quite frequently, “superglobal variables” do not get written/updated properly in all instances. :thinking:

For me, about 15% of the time, one of three instances fails to update to the new value, and will continue showing the oldValue. (The oldValue will stick until the piston pushes new data)

This has caused me to abandon using superglobals for any data that changes often. I am also making sure that the important pistons are in the same instance as the piston that is writing to those superglobals. So far, the same instance has always shown the correct data… The errors have always been between instances.