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

Patrick Mueller commented on CB-1666:
-------------------------------------

Noticed you're using modal prompts in your UI.  Not great.  The amount of time 
weinre will (by default) wait to hear back from a target before deciding it's 
dead is 15 sec.  Use "weinre --?" and look at --deathTimeout.

You can up that timeout to a few minutes, or something.  Downside is that dead 
targets won't get marked as dead till that long, and will litter your Targets 
list in the Remote panel of weinre.

Working modally like that, was difficult to keep weinre connected, and the 
workflow for hitting the link then the alert made turn-around per test too 
long.  I changed to update a <span> I added to the doc, and was able to run the 
test repeatedly without any issues.

Think I'll chalk this fix up as a winner.
                
> [weinre] "INVALID_STATE_ERR: DOM Exception 11" with 
> chbrody/Cordova-SQLitePlugin
> --------------------------------------------------------------------------------
>
>                 Key: CB-1666
>                 URL: https://issues.apache.org/jira/browse/CB-1666
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: weinre
>    Affects Versions: 2.1.0
>         Environment: OS X Lion 10.7.4, Google Chrome 22.0.1229.94, iOS6 
> iPhone Simulator
>            Reporter: Christiaan van Zyl
>            Assignee: Patrick Mueller
>         Attachments: weinre_test.html
>
>
> When using weinre with Cordova-SQLitePlugin we get a javascript error:
> "INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object 
> that is not, or is no longer, usable. File: 
> http://192.168.1.169:1337/target/target-script-min.js?_=1350463351336 Line 
> Number: 2794"
> Above line number corresponds to the function 
> NetworkRequest.prototype.handleDone in target-script-min.js.
> As a work around I have just wrapped a try catch and made it fail silently:
> NetworkRequest.prototype.handleDone = function() {
>     try {
>         var description, sourceString, status, statusText, success, time;
>         sourceString = this.xhr.responseText;
>         Weinre.wi.NetworkNotify.setInitialContent(this.id, sourceString, 
> "XHR");
>         time = Date.now() / 1000.0;
>         status = this.xhr.status;
>         if (status === 0) {
>             status = 200;
>         }
>         statusText = this.xhr.statusText;
>         success = status >= 200 && status < 300;
>         if (success) {
>             return Weinre.wi.NetworkNotify.didFinishLoading(this.id, time);
>         } else {
>             description = "" + status + " - " + statusText;
>             return Weinre.wi.NetworkNotify.didFailLoading(this.id, time, 
> description);
>         }
>     } catch (e) {
>         return;
>     }
> };

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to