Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
While trying to run a real open-social application (TypeRacer) on Shindig, After some tracing, I think I found a bug.
When calling an RPC service, execution arrives at rpc.js, to the function
function process(rpc)
In that function, there is a line:
var result = service.apply(rpc, rpc.a);
Where :
- service is a function, typically registered by gadgets.IfrGadgetService, in this case, it is the function gadgets.IfrGadgetService.prototype.requestNavigateTo
- rpc is a struct containing 5 fields related to the request (s, f, c, a, t).
According to the Javascript documentation:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Function:apply
The "apply" function takes two arguments: the first it the "this" variable and the second is the array of arguments.
So, in this case, the "this" variable is the rpc struct, but it is passed to a function that belongs to the gadgets.IfrGadgetService class!
This causes an obvious Javascript error on requestNavigateTo.
A second problem is that the requestNavigateTo function navigates to "http://localhost/canvas". This is because of the function
gadgets.IfrGadgetService.prototype.getUrlForView
which says:
"This is a silly implementation that will need to be overriden by almost all real containers"
and just returns "/canvas" when the gadget requests to navigate to a canvas view.