Hi Tobias -

It is possible (in rare cases) that the resulting state is {"a": "1",
"b": "2"} or {"a": "2", "b": "1"}. The wave server treats changes to
separate keys as modifications of the document in two different
places. There is no guarantee that those 4 modifications would happen
in particular order.

The only way to guarantee that two values always change together is to
attach them to the same key. For example: {ab:
gadgets.json.stringify({a: "1", b: "1"})} and {ab:
gadgets.json.stringify({a: 2, b: 2})}. The stored json object will
always be either {a: "1", b: "1"} or {a: "2", b: "2"}

You should decide whether you need those two properties to always
change together. Alternatively, you can store the info in
per-participant keys, and decide yourself how to merge them in the
display.

- pamela


On Wed, Jan 20, 2010 at 8:04 AM, Tobias <[email protected]> wrote:
> Thanks for your reply!
>
> I have another question about how the Wave server resolves conflicting
> deltas:
>
> Let's say Client 1 submits the delta {"a": "1", "b": "1"}. On the same
> time Client 2 submits the delta {"a": "2", "b": "2"}.
>
> Is it possible that the resulting state could be  {"a": "1", "b": "2"}
> or {"a": "2", "b": "1"}?
> Or is is for sure that the state is either {"a": "1", "b": "1"} or
> {"a": "2", "b": "2"}?
>
>
>
> On 18 Jan., 13:34, "pamela (Google Employee)" <[email protected]>
> wrote:
>> That's a good observation. I think I would agree with you. It should
>> only be necessary to iterate through the -vote keys and count them up.
>>  I imagine the author does the aggregate state for simplicity. Since
>> he does keep all the state, he could decide to check the aggregate
>> every so often and see if it was still correct (and update it if not).
>> The good news is that he hasn't lost any data, and could change his
>> gadget to work without that state at any time.
>>
>> I'll point that out in future talks.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Wave API" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-wave-api?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to