You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Braden Shepherdson (JIRA)" <ji...@apache.org> on 2012/09/07 16:10:07 UTC

[jira] [Created] (CB-1388) Add reset() to plugin API and fix callback collisions on all platforms

Braden Shepherdson created CB-1388:
--------------------------------------

             Summary: Add reset() to plugin API and fix callback collisions on all platforms
                 Key: CB-1388
                 URL: https://issues.apache.org/jira/browse/CB-1388
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android, Bada, BlackBerry, CordovaJS, iOS, Qt, Tizen, webOS, Windows 8, WP7
    Affects Versions: 2.0.0
            Reporter: Braden Shepherdson
            Assignee: Braden Shepherdson
             Fix For: 2.2.0


There are three parts to this bug.

First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 

Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.

Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.

I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

--
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-1388) Add reset() to plugin API and fix callback collisions on all platforms

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

Shazron Abdullah updated CB-1388:
---------------------------------

    Fix Version/s:     (was: 2.2.0)
                   2.3.0
    
> Add reset() to plugin API and fix callback collisions on all platforms
> ----------------------------------------------------------------------
>
>                 Key: CB-1388
>                 URL: https://issues.apache.org/jira/browse/CB-1388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Bada, BlackBerry, CordovaJS, Qt, Tizen, webOS
>    Affects Versions: 2.0.0
>            Reporter: Braden Shepherdson
>            Assignee: Braden Shepherdson
>             Fix For: 2.3.0
>
>
> There are three parts to this bug.
> First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 
> Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.
> Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.
> I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

--
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-1388) Add reset() to plugin API and fix callback collisions on all platforms

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

Jesse MacFadyen commented on CB-1388:
-------------------------------------

I don't believe part 2 (randomized callbackIds) of this task is required. This would only be required if part 1 does not work correctly.
                
> Add reset() to plugin API and fix callback collisions on all platforms
> ----------------------------------------------------------------------
>
>                 Key: CB-1388
>                 URL: https://issues.apache.org/jira/browse/CB-1388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Bada, BlackBerry, CordovaJS, iOS, Qt, Tizen, webOS, Windows 8, WP7
>    Affects Versions: 2.0.0
>            Reporter: Braden Shepherdson
>            Assignee: Braden Shepherdson
>             Fix For: 2.2.0
>
>
> There are three parts to this bug.
> First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 
> Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.
> Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.
> I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

--
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-1388) Add reset() to plugin API and fix callback collisions on all platforms

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

Jesse MacFadyen updated CB-1388:
--------------------------------

    Component/s:     (was: Windows 8)
                     (was: WP7)
    
> Add reset() to plugin API and fix callback collisions on all platforms
> ----------------------------------------------------------------------
>
>                 Key: CB-1388
>                 URL: https://issues.apache.org/jira/browse/CB-1388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Bada, BlackBerry, CordovaJS, iOS, Qt, Tizen, webOS
>    Affects Versions: 2.0.0
>            Reporter: Braden Shepherdson
>            Assignee: Braden Shepherdson
>             Fix For: 2.2.0
>
>
> There are three parts to this bug.
> First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 
> Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.
> Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.
> I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

--
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-1388) Add reset() to plugin API and fix callback collisions on all platforms

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

Braden Shepherdson updated CB-1388:
-----------------------------------

    Component/s:     (was: Android)
                     (was: iOS)
    
> Add reset() to plugin API and fix callback collisions on all platforms
> ----------------------------------------------------------------------
>
>                 Key: CB-1388
>                 URL: https://issues.apache.org/jira/browse/CB-1388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Bada, BlackBerry, CordovaJS, Qt, Tizen, webOS
>    Affects Versions: 2.0.0
>            Reporter: Braden Shepherdson
>            Assignee: Braden Shepherdson
>             Fix For: 2.2.0
>
>
> There are three parts to this bug.
> First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 
> Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.
> Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.
> I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

--
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-1388) Add reset() to plugin API and fix callback collisions on all platforms

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

Braden Shepherdson commented on CB-1388:
----------------------------------------

I've got the Javascript changes for part 2 complete, but I'm sitting on them until 2.1.0 goes out.
                
> Add reset() to plugin API and fix callback collisions on all platforms
> ----------------------------------------------------------------------
>
>                 Key: CB-1388
>                 URL: https://issues.apache.org/jira/browse/CB-1388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Bada, BlackBerry, CordovaJS, iOS, Qt, Tizen, webOS
>    Affects Versions: 2.0.0
>            Reporter: Braden Shepherdson
>            Assignee: Braden Shepherdson
>             Fix For: 2.2.0
>
>
> There are three parts to this bug.
> First, platform-specific: we should add a reset() function to the plugin API which is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This won't be relevant to some platforms 
> Second, platform-independent: the callback IDs generated on the Javascript side should be randomized in some way to prevent collisions after navigation. Otherwise a request might get the ID "Service1", and before it has a chance to complete we navigate and a new request is made, also receiving "Service1". Then the first response comes back and the new Service1 callback is handed the old results.
> Third, we should add a test for this to Mobile Spec, if possible. This is a tricky thing to reproduce reliably, unfortunately.
> I'll tackle the second and third parts, and Android for the first part. It would be great if people who work on other platforms would add the reset() logic, or close the platform bugs if the platform is all-Javascript and fully reloaded on navigation.

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