[cosmo-dev] Putting the A back in Ajax
Travis Vachon
travis at osafoundation.org
Wed Nov 14 10:54:39 PST 2007
>
>
> 1. There are some cases where sync is really what we want.
True, though in general I'm not on board with the "if we need it to
render the ui we can safely do it synchronously," as there are other
things I like to do with my web browser while stuff loads in the cosmo
tab. There is some code doing some lazy loading of collection
properties (title, urls, etc) that would in theory still need to be
done synchronously. Happily/unhappily this is actually moot now
because all of these are triggered at load time with the new
collection selector. I'll probably just take this code out :)
>
>
> 2. We would need to build in our own timeout mechanism in the UI
> code to deal with the requests that never return any data.
>
> IIRC, a lot of the sync calls are associated with the initial load
> of the app.
>
> With all-async calls and an unresponsive server, you'd get your UI,
> but none of your data would be there. We'd still need to return some
> kind of error to the user (but at least the error would be nicer
> than a script timeout).
>
> We need to do some work on this anyway now that we have the concept
> of deleting a collection, which implies that the UI should
> eventually display properly even if there's no data.
>
> The difference would be that with a failed background fetch of their
> data, eventually we need to show them the "oh noes" message.
Cool, I'll make sure to keep an eye out for this.
>
>
> 3. Ops that users expect to happen more-or-less in real time.
>
> This is very similar to 2. Examples would be things like renaming a
> collection or updating your preferences. We can move to a callback-
> style for those that are implemented as sync -- but the operation
> from the UI standpoint should still pretty much block (i.e., the
> user sees a processing status message until the request either
> succeeds or fails).
_Definitely_. The whole point here is the "cosmo block" doesn't need
to mean "browser block" :-D
Thanks! I imagine I'll be pinging you throughout this process :)
-Travis
More information about the cosmo-dev
mailing list