[ 
https://issues.apache.org/jira/browse/SHINDIG-1497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989187#comment-12989187
 ] 

Maxwell Chiareli commented on SHINDIG-1497:
-------------------------------------------

What does change when drag and drop? maybe it's possible to add another 
condition to if clause, like: if (typeof sameDomain[target] === 'undefined' || 
sameDomain[target].someProperty != target.someProperty) . I did not find any 
different property

> pubsub2 breaks due to exception after drag and drop of gadget
> -------------------------------------------------------------
>
>                 Key: SHINDIG-1497
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1497
>             Project: Shindig
>          Issue Type: Bug
>          Components: Javascript 
>    Affects Versions: 2.0.2, 3.0.0
>            Reporter: Dennis Ju
>            Priority: Minor
>         Attachments: SHINDIG-1497.diff
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to