Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-515

Bug in requestNavigateTo

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • None
    • Javascript
    • 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.

      Attachments

        1. RequestNavigateTo.patch
          11 kB
          Erel Segal

        Activity

          People

            Unassigned Unassigned
            erelsgl Erel Segal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified