You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Christiaan van Zyl (JIRA)" <ji...@apache.org> on 2012/10/17 11:22:03 UTC

[jira] [Created] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Christiaan van Zyl created CB-1666:
--------------------------------------

             Summary: "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin
                 Key: CB-1666
                 URL: https://issues.apache.org/jira/browse/CB-1666
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaJS, iOS, 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: Filip Maj


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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478915#comment-13478915 ] 

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

I'll see if I can try this out.

In the meantime:

- you can try the 2.2.0 release candidate - http://markmail.org/message/c6f6tbcxfgstrepb
- use the --debug flag on weinre, perhaps something interesting will be dumped to the terminal window
- you should be able to run weinre AND real remote web inspector at the same time; pretty sure I've done this.  You may get a clue about what's going on.

                
> [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

[jira] [Updated] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mueller updated CB-1666:
--------------------------------

    Summary: [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin  (was: "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin)
    
> [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
>
> 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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477880#comment-13477880 ] 

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

Couple of q's:

- what version of Cordova are you using?
- what version of iOS are you using?  Does it do the same thing on other versions of iOS?
- wanted to double-check that this error message is just spurious, and shouldn't be displayed, but is not hindering your app in any way.

Looking at the code, I honestly can't see how this is even happening, at least with the current level of Cordova code.  It seems like the XHR in question must be a "/!gap" XHR request, as part of the exec() impl [1], but ... it doesn't add any handlers, and so I don't see how it could "close" (or something) the XHR.

I suppose it may be related to accessing the XHR responseText attribute if it's "not text" or something [2].  It would be nice to know if that's ALL we had to wrap, but ... this all seems so sketchy, it seems like wider-ranging try/catch would be safer.

Seems like the safest thing to do is to put a try/catch around the getXhrEventHandler() function in NetworkRequest [3].  This may result in some XHR requests in weinre as not being complete, but there were going to be SOME KIND of problem with such requests anyway, apparently :-)

I've seen some seemingly spurious but innocuous "INVALID_STATE_ERR: DOM Exception blah blah" messages before, but never nailed down where they were coming from.  Hopefully this will get rid of some/most/all of them!

Thoughts?

[1] https://github.com/apache/incubator-cordova-js/blob/master/lib/ios/exec.js#L124
[2] http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute
[3] https://github.com/apache/incubator-cordova-weinre/blob/master/weinre.web/modules/weinre/target/NetworkRequest.coffee#L189

                
> [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
>
> 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

[jira] [Comment Edited] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478841#comment-13478841 ] 

Christiaan van Zyl edited comment on CB-1666 at 10/18/12 9:07 AM:
------------------------------------------------------------------

I've managed to separate out the code and created a test page, see attached: "weinre_test.html"

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

                
      was (Author: mozey):
    I've managed to separate out the code and created a test page, see attached.

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

                  
> [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

[jira] [Updated] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mueller updated CB-1666:
--------------------------------

    Component/s:     (was: CordovaJS)
                     (was: iOS)
    
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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

[jira] [Updated] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christiaan van Zyl updated CB-1666:
-----------------------------------

    Attachment: weinre_test.html
    
> [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

[jira] [Updated] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christiaan van Zyl updated CB-1666:
-----------------------------------

    Attachment: weinre_test.html
    
> [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

[jira] [Commented] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477740#comment-13477740 ] 

Christiaan van Zyl commented on CB-1666:
----------------------------------------

I assume so, the javascript error above has only occured when I am using weinre. I got the error text above from using window.onerror on the page running in the iOS6 iPhone Simulator.

                
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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

[jira] [Comment Edited] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478841#comment-13478841 ] 

Christiaan van Zyl edited comment on CB-1666 at 10/18/12 9:08 AM:
------------------------------------------------------------------

I've managed to separate out the code and created a test page, see attached: "weinre_test.html"

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my test page code or the plugin...

                
      was (Author: mozey):
    I've managed to separate out the code and created a test page, see attached: "weinre_test.html"

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

                  
> [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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478841#comment-13478841 ] 

Christiaan van Zyl commented on CB-1666:
----------------------------------------

I've managed to separate out the code and created a test page, see attached.

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

                
> [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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478818#comment-13478818 ] 

Christiaan van Zyl commented on CB-1666:
----------------------------------------

I've managed to separate out the code and created a test page, see [1]. Not sure how to attach files?

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

[1]

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
    <script src="external/Cordova-SQLitePlugin/iOS/www/SQLitePlugin.js"></script>
    <script src="http://192.168.1.169:1337/target/target-script-min.js#anonymous"></script>
</head>
<body>

<a href="javascript:" onclick="fRunTest();">Run Test</a>

<script>
    window.onerror = function(sMessage, sFileName, nLineNumber) {
        alert(sMessage + " " + sFileName + " " + nLineNumber)
    };

    /**
     * Insert rows into specified table.
     * @param {string} sTableName
     * @param {object[]} aRows
     * @param {function} fCallback
     */
    fInsertRows = function(sTableName, aRows, fCallback) {
        var db = window.sqlitePlugin.openDatabase("sqlite.db", "1.0", "Application Data", 20000);
        db.transaction(function(tx) {
            tx.executeSql(
                'CREATE TABLE IF NOT EXISTS ' + sTableName + ' (' +
                'id integer primary key, ' +
                'value text)'
            );
        });

        var fLoop = function() {
            var Row = aRows.shift();
            var nRows = aRows.length;
            var sColumns = "";
            var sPlaceholders = "";
            var aValues = [];
            for (var sColumnName in Row) {
                var value = Row[sColumnName];
                if (sColumns.length > 0) {
                    sColumns += ", ";
                    sPlaceholders += ", ";
                }
                sColumns += sColumnName;
                sPlaceholders += "?";
                aValues.push(value);
            }

            var fError = function(e) {
                alert(JSON.stringify(e, null, 2));
            };

            db.transaction(function(tx) {
                tx.executeSql(
                    "insert into " + sTableName + " (" + sColumns + ") values (" + sPlaceholders + ")",
                    aValues,
                    function() {
                        if (nRows > 0) {
                            fLoop();
                        } else {
                            fCallback();
                        }
                    },
                    fError
                );
            });
        };
        fLoop();
    };

    function fRunTest() {
        fInsertRows(
            "test",
            [
                {
                    "value": "1234567890"
                },
                {
                    "value": "aaaaaaaaaaa"
                }
            ],
            function() {
                alert("done");
            }
        );
    }

    // Wait for Cordova to load
    document.addEventListener(
        "deviceready",
        function() {
            alert("ready");
        },
        false
    );
</script>

</body>
</html>



                
> [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
>
> 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

[jira] [Updated] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christiaan van Zyl updated CB-1666:
-----------------------------------

    Comment: was deleted

(was: I've managed to separate out the code and created a test page, see [1]. Not sure how to attach files?

Running this page with weinre 2.0.0-pre-H41DGW8S-incubating I get the error as described above intermittently. When I comment out the weinre include script I do not get the error.

Running this page with the patch 2.0.0-pre-H8EOSCLN-incubating I do not get the error, but the connection to weinre dies after running the test a couple of times.

I guess it might also be some bug in my code below or the plugin...

[1]

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
    <script src="external/Cordova-SQLitePlugin/iOS/www/SQLitePlugin.js"></script>
    <script src="http://192.168.1.169:1337/target/target-script-min.js#anonymous"></script>
</head>
<body>

<a href="javascript:" onclick="fRunTest();">Run Test</a>

<script>
    window.onerror = function(sMessage, sFileName, nLineNumber) {
        alert(sMessage + " " + sFileName + " " + nLineNumber)
    };

    /**
     * Insert rows into specified table.
     * @param {string} sTableName
     * @param {object[]} aRows
     * @param {function} fCallback
     */
    fInsertRows = function(sTableName, aRows, fCallback) {
        var db = window.sqlitePlugin.openDatabase("sqlite.db", "1.0", "Application Data", 20000);
        db.transaction(function(tx) {
            tx.executeSql(
                'CREATE TABLE IF NOT EXISTS ' + sTableName + ' (' +
                'id integer primary key, ' +
                'value text)'
            );
        });

        var fLoop = function() {
            var Row = aRows.shift();
            var nRows = aRows.length;
            var sColumns = "";
            var sPlaceholders = "";
            var aValues = [];
            for (var sColumnName in Row) {
                var value = Row[sColumnName];
                if (sColumns.length > 0) {
                    sColumns += ", ";
                    sPlaceholders += ", ";
                }
                sColumns += sColumnName;
                sPlaceholders += "?";
                aValues.push(value);
            }

            var fError = function(e) {
                alert(JSON.stringify(e, null, 2));
            };

            db.transaction(function(tx) {
                tx.executeSql(
                    "insert into " + sTableName + " (" + sColumns + ") values (" + sPlaceholders + ")",
                    aValues,
                    function() {
                        if (nRows > 0) {
                            fLoop();
                        } else {
                            fCallback();
                        }
                    },
                    fError
                );
            });
        };
        fLoop();
    };

    function fRunTest() {
        fInsertRows(
            "test",
            [
                {
                    "value": "1234567890"
                },
                {
                    "value": "aaaaaaaaaaa"
                }
            ],
            function() {
                alert("done");
            }
        );
    }

    // Wait for Cordova to load
    document.addEventListener(
        "deviceready",
        function() {
            alert("ready");
        },
        false
    );
</script>

</body>
</html>


)
    
> [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
>
> 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

[jira] [Commented] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477743#comment-13477743 ] 

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

Thanks.  BTW, you really went out of your way there.  If you're on iOS6, you don't need to use weinre any more, you can use real remote web inspector: http://moduscreate.com/enable-remote-web-inspector-in-ios-6/
                
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477748#comment-13477748 ] 

Christiaan van Zyl commented on CB-1666:
----------------------------------------

Thanks for the link, just upgraded to iOS6 yesterday. I might have to make my app work in Android as well at a later stage so keep up the good work!
                
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478063#comment-13478063 ] 

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

I have a patch available in a build.  You can install it via:

    sudo npm -g uninstall weinre # for good measure

    sudo npm -g install http://people.apache.org/~pmuellr/weinre/builds/2.0.0-pre-H8EOSCLN-incubating/apache-cordova-weinre-2.0.0-pre-H8EOSCLN-incubating-bin.tar.gz # sorry for the long url

If you get a chance to try this, let me know how it goes.
                
> [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
>
> 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

[jira] [Updated] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christiaan van Zyl updated CB-1666:
-----------------------------------

    Attachment:     (was: weinre_test.html)
    
> [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

[jira] [Commented] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Christiaan van Zyl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477941#comment-13477941 ] 

Christiaan van Zyl commented on CB-1666:
----------------------------------------

> what version of Cordova are you using?

2.1.0

> what version of iOS are you using? Does it do the same thing on other versions of iOS?

iPhone Simulator
Version: 6.0 (10A403)

> wanted to double-check that this error message is just spurious, and shouldn't be displayed, but is not hindering your app in any way.

I only get the message intermittently. Had the app crash a couple of times but not nearly as much as I got that message, not sure if the message is related to the crash.

Only get this message when writing to SQLite database using a plugin, so not sure how to extract a simple example of what is actually causing it.


                
> [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
>
> 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

[jira] [Resolved] (CB-1666) [weinre] "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mueller resolved CB-1666.
---------------------------------

    Resolution: Fixed

fixed in commit: 

    https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-weinre.git;a=commit;h=441566b4cbbcfd6c886aea3f62883a3ca449dbd0

available at npm as version 2.0.0-pre-H8EOSCLN-incubating :

    https://npmjs.org/package/weinre
                
> [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

[jira] [Commented] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477732#comment-13477732 ] 

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

Thanks Christian!  I assume this is only a weinre issue, and not an issue with Cordova iOS itself.  I've changed the components to indicate that, but correct me if I'm wrong.
                
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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

[jira] [Assigned] (CB-1666) "INVALID_STATE_ERR: DOM Exception 11" when using weinre with chbrody/Cordova-SQLitePlugin

Posted by "Patrick Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mueller reassigned CB-1666:
-----------------------------------

    Assignee: Patrick Mueller  (was: Filip Maj)
    
> "INVALID_STATE_ERR: DOM Exception 11" when using weinre 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
>
> 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