Important Google Wave Extension Development Note: Don't use booleans

by Stephen Fluin 2009.11.10

Javascript has been around for a long time, and booleans are one of the most standard types in programming. Unfortunately Google's Google Wave doesn't agree. In standard wave extension programming, one can place objects into the wave state as follows:

delta = {};
delta["key"] = value;
wave.getState().submitDelta(delta);

In most cases, this works great, but in case you are trying to use booleans as your value, you will find that Google Wave will not store the boolean value in the state. Not true, not false, and it won't trigger a standard state update that one would normally expect.

The way I have worked around this is to simply use the strings "true" and "false" for these values, and then use string comparison for conditional logic. It seems a little hackish, but it also seems to work in all of the cases I have tried or needed it in.


permalink