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

pubsub2 breaks due to exception after drag and drop of gadget


    • Type: Bug
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.2, 2.5.0-beta1
    • Fix Version/s: None
    • Component/s: Javascript
    • Labels:


      After dragging and dropping a gadget rendered using pubsub-2, the following exception is thrown when attempting to pub/sub/unsubscribe:

      "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) nsIDOMJSWindow.setTimeout"

      The issue appears to be in rpc.js in the method callSameDomain(target, rpc) (line 481 in rev 1065708). The first "if" clause is an optimization to avoid redefining sameDomain[target] (line 495) if the value is already defined. But the problem is that after you drag and drop, the target element value targetEl (line 492) has changed, which also means the value of sameDomain[target] has changed (line 495). But since sameDomain[target] is already defined, the code doesn't update the value of sameDomain[target], but instead jumps to calling the rpc (line 505).

      A simple workaround would be to comment out the "if" clause and matching brace (lines 482 and 501), but this of course removes the optimization as well. A better approach may be to have a callback to update sameDomain[target] or a global boolean variable indicating when sameDomain[target] needs to be updated.




            • Assignee:
              dennisju Dennis Ju
            • Votes:
              2 Vote for this issue
              2 Start watching this issue


              • Created: