[cosmo-dev] Putting the A back in Ajax
Travis Vachon
travis at osafoundation.org
Wed Nov 21 11:05:59 PST 2007
r6248-r6252 implement this functionality.
A couple notes:
I've tested this and run done a windmill run but the kind of bugs this
work may introduce could be subtle. Keep an eye out for rendering
glitches and out of sync data after server operations like creation
and save. The work ended up being more straightforward than I expected
so I don't anticipate anything major.
Matthew: if you'd like to take a few minutes to review the checkins it
would be a nice safety blanket :)
Thanks!
-Travis
On Nov 14, 2007, at 9:42 AM, Travis Vachon wrote:
> Hi folks
>
> The recent problem on hub highlighted a flaw in our client code,
> namely our use of synchronous XHR calls. A grep for the parameter
> that makes this happen looks like:
>
> ~/Development/osaf/cosmo/git/cosmo/src/main/webapp/js/cosmo% grep -r
> -e "sync: \?true" *
> app/pim.js: var collection =
> this.serv.getCollection(params.collectionUrl, {sync:true}).results[0];
> app/pim.js: var userCollections =
> this.serv.getCollections({sync: true}).results[0];
> app/pim.js: var subscriptions =
> this.serv.getSubscriptions({sync:true}).results[0];
> service/conduits/
> common
> .js:
> {sync: true}).results[0];
> service/conduits/
> common
> .js:
> {sync: true, noAuth: true}).results[0];
> ui/imagegrid.js: sync: true,
> view/cal/common.js: { start: start, end:
> end }, { sync: true });
> view/list/canvas.js: { sync: true })];
> view/list/canvas.js: { sync: true }));
> view/list/common.js: { sync: true });
> view/service.js: var deferred =
> cosmo
> .app
> .pim
> .serv.getCollection(cosmo.app.pim.currentCollection.getUrls().self,
> {sync:true});
>
>
> As you can see, we're using synchronous calls quite a bit. This
> means that while the browser is waiting for the server to return
> data the entire program hangs, something you probably noticed if you
> signed into hub yesterday. The solution is to convert all these
> pieces of code to a callback based model and make the XHR calls
> asynchronously.
>
> I'd be happy to make this happen, but wanted to ping the list for
> comments and ideas on potential gotchas.
>
> Thoughts?
>
> -Travis
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev
More information about the cosmo-dev
mailing list