[
https://issues.apache.org/jira/browse/SHINDIG-1497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Ju updated SHINDIG-1497:
-------------------------------
Description:
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.
was:
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).
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.
> 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