Review Board 1.7.22

Change osapi._registerMethods to 'last one in wins'

Review Request #1211 - Created July 27, 2011 and submitted

Dan Dumont
While debugging using a container cross-site from where shindig is hosted, I ran into trouble using:
  config[osapi.container.ServiceConfig.API_PATH] = '/rpc';
  config[osapi.container.ServiceConfig.API_HOST] = // A url to a proxy on the host server that points to the shindig server.

I found that the osapi.container.Service.prototype.registerOsapiServices function was defining methods that never ended up sticking, because other methods would beat it to the punch.
This resulted in the above settings never taking hold.
Tested navigate gadget in a cross-hosted container environment (vanilla web host loading CC from shindig server).
Tested navigate gadget in SampleContainer (same host).
Review request changed
Updated (Aug. 12, 2011, 2:44 p.m.)
Posted (Sept. 14, 2011, 10:16 p.m.)
LGTM Dan.  My one concern is that there is existing code that depends on the old behavior.  Are there any unit tests around this code?  Can you think of any way to figure out if there is any code that depends on the old behavior?  Just want to know how certain we are that this is not going to bite us.
  1. We've been running with this change for quite a while now and I haven't seen any negative consequences to the change.
    It has been instrumental though in allowing us to load a container into a page on another domain.
    If anyone knows of any unit tests specifically related to this area I can investigate and create more.
Ship it!
Posted (Sept. 15, 2011, 3:56 p.m.)
I'm inclined to add this.  It's really hard to test this since it's mainly in integrations where this matters.
Ship it!
Posted (Sept. 16, 2011, 1:36 p.m.)
Committed revision 1171551.