State change

1 view
Skip to first unread message

Mojo

unread,
Dec 4, 2009, 5:58:42 AM12/4/09
to Google Wave API
I have a Gadget - It allows a user to input a large amount of text
which is then automatically split into small chunks (aka pages) which
the Gadget displays.

One of the features is that the Gadget automatically saves an
individual user's "bookmark" each time he or she clicks to view a new
page of text.

If they then close the wave and come back later, the Gadget loads at
the saved position.

That all works ok. Except... in saving this bookmark the wave state is
changed. This means that the wavelet is marked as having been updated,
and the wave shows as unread in the inboxes of all viewers of the
wave, even though nothing at all has changed as far as most viewers
are concerned - just that some other guy clicked to view a new page.

What I need here is a way to save the individual's bookmark setting
without triggering that "updated" action for everyone else. I imagine
this would be useful for a lot of other people building Gadgets in the
future. It starts to irritate users if they see the wave almost
permanently at the top of their inbox when nothing has actually
happened.

Is there already a way to do this, does anyone know?

David Nesting

unread,
Dec 5, 2009, 11:43:02 AM12/5/09
to google-...@googlegroups.com
On Fri, Dec 4, 2009 at 2:58 AM, Mojo <oga...@hotmail.co.uk> wrote:
What I need here is a way to save the individual's bookmark setting
without triggering that "updated" action for everyone else. I imagine

Can gadgets write browser cookies?
What if you saved this state in a server-side data store (wherever your gadget is hosted)?

David

Mojo

unread,
Dec 5, 2009, 5:13:27 PM12/5/09
to Google Wave API
Browser cookies are definitely a possibility. The only issue I have
with that is that I wanted to use the Wave datastore because it's
obviously portable, so it will work if you log in on a different
machine somewhere else.

Saving the data server side is also an option, but again I would
prefer to use Wave's built in capabilities if at all possible.

I still think there should be a way for Gadgets to store data to the
datastore without changing the "unread" status of the wave. Is there??

I think this issue is probably affecting other Gadgets, not just mine.
I see other waves rising to the top of my inbox, and when I go to look
at them nothing appears to have actually changed.

I'll read up a bit more. I have Sandbox access now, and there might be
more info on there.

Avital Oliver

unread,
Dec 6, 2009, 3:23:47 AM12/6/09
to google-...@googlegroups.com
Gadgets are executed in iframes with variable domains (something like
*-opensocial.google.com where * can be any number). Cookies are stored
on a per-domain basis, so you may or may not be able to read the
cookie you stored once you open the wave containing the gadget a
second time.

--
http://wave.theWE.net
http://twitter.com/theWE_
> --
>
> You received this message because you are subscribed to the Google Groups "Google Wave API" group.
> To post to this group, send email to google-...@googlegroups.com.
> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
>
>
>

David Nesting

unread,
Dec 6, 2009, 10:38:53 AM12/6/09
to google-...@googlegroups.com
On Sun, Dec 6, 2009 at 12:23 AM, Avital Oliver <avi...@thewe.net> wrote:
Gadgets are executed in iframes with variable domains (something like
*-opensocial.google.com where * can be any number). Cookies are stored
on a per-domain basis, so you may or may not be able to read the
cookie you stored once you open the wave containing the gadget a
second time.

Interesting, so you're saying that the domain may change from one instantiation of the gadget to another?  I expected that the domain would be unique, but persistent.

David

Avital Oliver

unread,
Dec 6, 2009, 3:06:20 PM12/6/09
to google-...@googlegroups.com
Not only may, it does. Take a look at it. The number at the beginning changes. Not sure based on what, but I've seen it happen many times. I'm guessing the purpose it to make it harder to communicate information between different gadgets (as that might be a breach of privacy).

Dan

unread,
Dec 7, 2009, 6:26:51 PM12/7/09
to Google Wave API
Does that have implications for server side interaction as well? i.e.
Would this cause a cross domain conflict during an Ajax call to the
server?

I should try it, I know, but hopefully someone else already has.

Avital Oliver

unread,
Dec 9, 2009, 1:50:20 AM12/9/09
to google-...@googlegroups.com
You're right - you can't do any "regular" AJAX calls. All AJAX calls must respect the same-domain restriction. Instead, use a JSONP-like mechanism (a hack involving embedding a script tag by the DOM to load a server-side generated script with the information needed)

Dan

unread,
Dec 9, 2009, 5:20:50 AM12/9/09
to Google Wave API
Understood. Thanks!
Reply all
Reply to author
Forward
0 new messages