diminish7 / rave

A Google Wave robot client framework for Ruby
http://github.com/diminish7/rave
MIT License
62 stars 8 forks source link

Robot#create_wavelet has no effect #29

Open bil-bas opened 14 years ago

bil-bas commented 14 years ago

Operation serialises as:

{
"blipId":"",
"index":-1,
"waveletId":"",
"waveId":"googlewave.com!w+TuD7bJ_CK",
"type":"WAVELET_CREATE",
"javaClass":"com.google.wave.api.impl.OperationImpl",
"property":{
  "waveletId":"googlewave.com!conv+root",
  "javaClass":"com.google.wave.api.impl.WaveletData",
  "waveId":"googlewave.com!w+TuD7bJ_CK",
  "rootBlipId":"b+TuD7bJ_CL",
  "participants":["bil.bagpuss@googlewave.com","spooner-test@appspot.com"]
}
}

OK, that makes it obvious why it didn't make a new wavelet. Not sure why it is sending the current, rather than generated wavelet through. Gah!

bil-bas commented 14 years ago

Fixing that silly issue:

{
"blipId":"",
"index":-1,
"waveletId":"",
"waveId":"googlewave.com!w+TuD7bJ_CP",
"type":"WAVELET_CREATE",
"javaClass":"com.google.wave.api.impl.OperationImpl",
"property":{
  "waveletId":"TBD_wavelet_9_conv+root",
  "javaClass":"com.google.wave.api.impl.WaveletData",
  "waveId":"TBD_wave_8",
  "rootBlipId":"TBD_blip_10",
  "participants":["kasyntaxy@appspot.com","bil.bagpuss@googlewave.com"]
}
}

The result is nothing happens. I would expect myself to get a new wave in my inbox with the two of us in, according to what I've read.

bil-bas commented 14 years ago

Managed to get further when I realised I needed to serialize participants array as a proper "java" class. This netted me a WAVELET_CREATED event in return.

Note, there is an additional problem, in that now there will be too root wavelets with identical ids in the context => disaster and mayhem!

bil-bas commented 14 years ago

In the WAVELET_CREATED package, we get:


{"blips":{
"map":{"b+7dPLXbZkBPP":{
"lastModifiedTime":1260898981231,
"content":""
,"contributors":{"javaClass":"java.util.ArrayList","list":["spooner-test@appspot.com"]},
"waveletId":"google.com!conv+root",
"blipId":"b+7dPLXbZkBPP",
"javaClass":"com.google.wave.api.impl.BlipData",
"waveId":"google.com!w+7dPLXbZkBPO",
"annotations":{"javaClass":"java.util.ArrayList","list":[]},
"childBlipIds":{"javaClass":"java.util.ArrayList","list":[]},
"elements":{"map":{},"javaClass":"java.util.HashMap"},
"version":0,
"creator":"spooner-test@appspot.com"
}
},
"javaClass":"java.util.HashMap"},
"robotAddress":"spooner-test@appspot.com",
"events":{"javaClass":"java.util.ArrayList",
"list":[{"timestamp":1260898981232,
"modifiedBy":"spooner-test@appspot.com",
"javaClass":"com.google.wave.api.impl.EventData",
"properties":{"map":{"waveletId":"google.com!conv+root",
"blipId":"b+7dPLXbZkBPP",
"waveId":"google.com!w+7dPLXbZkBPO"},
"javaClass":"java.util.HashMap"},
"type":"WAVELET_CREATED"}]},
"wavelet":{"lastModifiedTime":1260898981232,
"title":"",
"waveletId":"google.com!conv+root",
"rootBlipId":"b+7dPLXbZkBPP",
"javaClass":"com.google.wave.api.impl.WaveletData",
"dataDocuments":{"map":{},"javaClass":"java.util.HashMap"},
"creationTime":1260898981229,
"waveId":"google.com!w+7dPLXbZkBPO",
"participants":{"javaClass":"java.util.ArrayList",
"list":["spooner-test@appspot.com","kasyntaxy@appspot.com","bil.bagpuss@googlewave.com"]},
"creator":"rusty@a.gwave.com",
"version":0}}

Which looks fine. Proving the wave has actually been created, but it doesn't appear in my inbox and trying to join it by manipulating the URL, I am told I'm not a participant of that wave. No idea where it is going...

bil-bas commented 14 years ago

Actually, there won't be 2 wavelets with the same ID, since I forgot that I generated a random ID. Ignore me ;) Still not the slightest idea why I don't get pulled into the new wavelet though, since I am a participant...