{ "id": "111211", "key": "TIMOB-13067", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15277", "description": "2013 Sprint 06 Core", "name": "2013 Sprint 06 Core", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-03-19T23:32:37.000+0000", "created": "2013-03-14T18:51:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "triage" ], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T22:12:23.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Issue\r\nAfter WebView.reload() is called, the document object within get a 'ready' event and the window gets a 'load' event. jQuery is used to detect the 'ready' event. The window 'load' event is detected with a standard addEventListener().\r\n\r\nh6.Expected results\r\nInside the 'ready' event handler, a 'isReady' flag is set true. When the window 'load' event handler executes, it is still true.\r\n\r\nh6.Actual results\r\nWhat's not expected is that sometime afterwards, the 'isReady' flag another other state goes away and new state appears. This can easily be seen by looking at the internal uuid that's globally created (intUuid). You'll notice that after the reload, a new value is generated (45926d11-60ec-2f85-ed95-16f311f1507f) as expected, but then a new value appears (4f0786c4-de9f-f0d7-2b03-46c7752b1431). \r\n\r\nThis appears to be a 2nd brand new global execution context inside the webview. This means that state in the 1st brand new global context (the one that has isRead flag set to true) is now gone.\r\n\r\nh6.Reproduction Steps \r\n1. start app\r\n2. notice external and internal uuids\r\n3. tap [dump] button\r\n4. notice external and internal uuids. they'll be the same as those in step 2.\r\n5. tap [reload] button\r\n6. notice a (na) external uuid, as expected\r\n7. notice in the document ready log, a brand new internal uuid and a isReady 8. flag set to false, as expected\r\n8. notice in the window load log, isReady flag is set to true, as expected\r\n9.now notice isDocReady log, both the internal uuid and the isReady flag are different from that in step 8\r\n\r\nh3.Events stack trace attached on debug mode\r\n\r\nh5.Load\r\n{code}\r\n[INFO][TiAPI ( 2428)] test.html: document ready: extUuid: na, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: false\r\n[INFO][TiAPI ( 2428)] test.html: window load: extUuid: na, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] app.js: webview.beforeload: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] app.js: webview.load: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: na, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n[INFO][TiAPI ( 2428)] app.js: eval'ing: myFunc('35f3b60f-e4aa-4698-b989-d9d260170d95')\r\n[INFO][TiAPI ( 2428)] test.html: myFunc: _extUuid: 35f3b60f-e4aa-4698-b989-d9d260170d95\r\n[INFO][TiAPI ( 2428)] test.html: myFunc: extUuid: 35f3b60f-e4aa-4698-b989-d9d260170d95, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: 35f3b60f-e4aa-4698-b989-d9d260170d95, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: 35f3b60f-e4aa-4698-b989-d9d260170d95, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n{code}\r\n\r\nh6.Dump\r\n{code}\r\n[INFO][TiAPI ( 2428)] app.js: dumping state for uuid: 35f3b60f-e4aa-4698-b989-d9d260170d95\r\n[INFO][TiAPI ( 2428)] test.html: dumpState: extUuid: 35f3b60f-e4aa-4698-b989-d9d260170d95, intUuid: b287c702-fc78-2195-b241-afecaa71c6be, isReady: true\r\n{code}\r\n\r\nh5.Reload\r\n{code}\r\n[INFO][TiAPI ( 2428)] app.js: resetting url\r\n[INFO][TiAPI ( 2428)] reloading...\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] test.html: document ready: extUuid: na, intUuid: 45926d11-60ec-2f85-ed95-16f311f1507f, isReady: false\r\n[INFO][TiAPI ( 2428)] test.html: window load: extUuid: na, intUuid: 45926d11-60ec-2f85-ed95-16f311f1507f, isReady: true\r\n[INFO][TiWebChromeClient.console( 2428)] (main) [49230,73278] Uncaught ReferenceError: Ti is not defined (20:file:///android_asset/Resources/test.html)\r\n[INFO][TiWebChromeClient.console( 2428)] (main) [2,73280] Uncaught ReferenceError: Ti is not defined (25:file:///android_asset/Resources/test.html)\r\n[INFO][TiAPI ( 2428)] app.js: webview.beforeload: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: na, intUuid: 4f0786c4-de9f-f0d7-2b03-46c7752b1431, isReady: false\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] app.js: webview.load: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] app.js: webview.beforeload: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] app.js: webview.load: uuid: na, url: file:///android_asset/Resources/test.html\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: na, intUuid: 4f0786c4-de9f-f0d7-2b03-46c7752b1431, isReady: false\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: na, intUuid: 4f0786c4-de9f-f0d7-2b03-46c7752b1431, isReady: false\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n[INFO][TiAPI ( 2428)] test.html: isDocReady: extUuid: na, intUuid: 4f0786c4-de9f-f0d7-2b03-46c7752b1431, isReady: false\r\n[INFO][TiAPI ( 2428)] will retry evalWhenReady...\r\n{code}", "attachment": [ { "id": "36310", "filename": "app.js", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T18:51:36.000+0000", "size": 1667, "mimeType": "text/javascript" }, { "id": "36309", "filename": "jquery-1.9.1.min.jsx", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T18:51:36.000+0000", "size": 92629, "mimeType": "application/octet-stream" }, { "id": "36308", "filename": "test.html", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T18:51:36.000+0000", "size": 1365, "mimeType": "text/html" } ], "flagged": false, "summary": "Android: Global execution context inside WebView disappears after load event", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Samsung Galaxy Nexus - Android 4.1.1\r\nTi 3.0.GA & 3.1 CI SDK", "comment": { "comments": [ { "id": "243068", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "See comment to TIMOB-13057", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-19T23:32:37.000+0000", "updated": "2013-03-19T23:32:37.000+0000" }, { "id": "408962", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T22:12:23.000+0000", "updated": "2017-03-03T22:12:23.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }