You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ripple.apache.org by "Arzhan Kinzhalin (JIRA)" <ji...@apache.org> on 2015/05/09 07:08:59 UTC

[jira] [Comment Edited] (RIPPLE-83) Cordova prepare logic is broken

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

Arzhan Kinzhalin edited comment on RIPPLE-83 at 5/9/15 5:08 AM:
----------------------------------------------------------------

Just to illustrate how the sequence looks like with the suggested change:
{code}
Request: GET /?enableripple=cordova-3.0.0-iPad
INFO: Set Device User Agent (String): "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10"
Request: POST /ripple/user-agent
refreshing project (platform: ios) ...
... done.
Request: GET /config.xml
Request: GET /
Request: GET /css/index.css
Request: GET /cordova.js
Request: GET /js/index.js
Request: GET /img/logo.png
{code}

None of the debug output is included in the PR, of course...


was (Author: busykai):
Just to illustrate how the sequence looks like with the suggested change:
{code}
Request: GET /?enableripple=cordova-3.0.0-iPad
INFO: Set Device User Agent (String): "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10"
Request: POST /ripple/user-agent
refreshing project (platform: ios) ...
... done.
Request: GET /config.xml
Request: GET /
Request: GET /css/index.css
Request: GET /cordova.js
Request: GET /js/index.js
Request: GET /img/logo.png
{code}

> Cordova prepare logic is broken
> -------------------------------
>
>                 Key: RIPPLE-83
>                 URL: https://issues.apache.org/jira/browse/RIPPLE-83
>             Project: Apache Ripple
>          Issue Type: Bug
>            Reporter: Arzhan Kinzhalin
>
> Cordova prepare is executed on the first {{GET}} which has {{enablecordova}} in the query. However, this request will have {{User-Agent}} from the previous device. Hence, wrong file tree could be refreshed. For example, when switching between an iPad to an Android device, the following happens:
> {code}
> refreshing project (platform: ios) ...
> ... done.
> Request: GET /?enableripple=cordova-3.0.0-Legend
> INFO: Set Device User Agent (String): "Mozilla/5.0 (Linux; U; Android 2.1; fr-fr; HTC Legend 1.32.163.1 Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"
> Request: GET /config.xml
> Request: GET /
> Request: GET /css/index.css
> Request: GET /cordova.js
> Request: GET /js/index.js
> Request: GET /img/logo.png
> {code}
> Note that {{ios}} platform is prepared while {{android}} is served later for the session.
> Instead, prepare should be done when {{User-Agent}} is set and the server duly notified. A PR is on the way.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)