dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

Bug: Robot not receiving correct gadget state #811

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
 So you have a gadget that does....

var a = {a: "1", b: "2", c: "3"}
wave.getState().submiteDelta(a);

Then a robot that does this...

def OnGadgetStateChanged(event, wavelet):
    g = event.blip.first(element.Gadget, url=<YOUR URL>)
    if g:
        logging.info(g.get("a"), "missing")
        logging.info(g.get("b"), "missing")
        logging.info(g.get("c"), "missing")

You would expect to see in the logs...
1, 2, 3.

However you see...
1, missing, missing.

Interestingly though if you change the order of a in the javascript to say 
{b:"2", a:"1", c:"3"}, you get...
2, missing, missing 

Original issue reported on code.google.com by tom.beve...@gmail.com on 23 Jun 2010 at 2:06

GoogleCodeExporter commented 8 years ago
I can't reproduce this behavior, can you provide a complete example that 
exhibits this?

Is the Javascript code above cut and paste from the code you are using? If so 
there are errors in it, as the name 'submitDelta' is spelled incorrectly, and 
the previous line is missing a semicolon.

Original comment by joe.gregorio@gmail.com on 25 Jun 2010 at 1:38

GoogleCodeExporter commented 8 years ago
A little further investigation reveals that the robot actually gets called 
twice. Once with the symptoms described above and the second time with the 
correct state.

Attached are two files that should demonstrate this. You will need to change 
the variable url in main.py to reflect where test.xml is hosted.

Tom

Original comment by tom.beve...@gmail.com on 25 Jun 2010 at 8:34

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, I can confirm the bug with that code.

Original comment by joe.gregorio@gmail.com on 8 Jul 2010 at 2:48