Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25217] iOS: WebView "fireEvent" causes app crash on 6.2.0.RC

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-05T21:32:36.000+0000
Affected Version/sRelease 6.2.0
Fix Version/sRelease 6.2.0
ComponentsiOS
Labelsfireevent, ios, regression, webview
ReporterAnthony Chung
AssigneeHans Knöchel
Created2017-09-01T02:52:38.000+0000
Updated2017-09-06T18:19:11.000+0000

Description

regression error: click href link in webview that uses fireevent causes crash crash occurs when using 6.2.0.v20170831112315 Same code works fine when using 6.1.2.GA 6.1.0.GA note in test env run-on-main-thread is not set jscore framework is not used simulator log code and safari debug inspector of the webview attached.

Attachments

FileDateSize
errorlog.txt2017-09-01T02:52:05.000+00002671
test.html2017-09-01T02:52:10.000+00003747

Comments

  1. Hans Knöchel 2017-09-01

    Hey there, thanks for the report! It -could be- is caused by [this line-change](https://github.com/appcelerator/titanium_mobile/commit/8296a594b523996ca057cf1352e23bce6ae43af7#diff-c3b1f31b61a796bea16bd0ed1610b084R66) as part of TIMOB-24769. We will investigate ist immediately and fix it for the GA, thank you! For QE: I also need to validate all other [SBJSON fragmentWithString:] calls to verify it did not broke other places as well. Reproducible test-case:
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var webview = Ti.UI.createWebView({
         url: 'test.html'
       })
       
       Ti.App.addEventListener('app:fromWebView:forum_discussions', function(e) {
         alert(e);
       });
       
       win.add(webview);
       win.open();
       
  2. Hans Knöchel 2017-09-01

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9386 PR (6_2_X): https://github.com/appcelerator/titanium_mobile/pull/9387
  3. Hans Knöchel 2017-09-05

    More test-cases for the above SBJSON-migration:
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff',
         layout: 'vertical'
       });
       
       Ti.App.addEventListener('customEvent', function(e) {
         alert('Event received successfully! Assert-value 1337 = 1337:'  + (e.payload.number == 1337))
       })
       
       addButtonWithListener('1) Trigger Ti.App event', triggerTiAppEvent)
       addButtonWithListener('2) Trigger Ti.Geolocation reserve-geocoder', triggerTiGeolocationGeocoder)
       
       win.open();
       
       function addButtonWithListener(title, cb) {
         var btn = Ti.UI.createButton({
           title: title,
           top: 40
         });
       
         btn.addEventListener('click', cb);
       
         win.add(btn);
       }
       
       function triggerTiAppEvent() {
         Ti.App.fireEvent('customEvent', { payload: { number: 1337 }});
       }
       
       function triggerTiGeolocationGeocoder() {
         Ti.Geolocation.reverseGeocoder(52.279911, 8.047179, function(e) {
           alert('Reverse geocoder success! See logs for more ...');
           Ti.API.info(e.places || []);
         });
       }
       
  4. Eric Wieber 2017-09-05

    FR Passed, using: MacOS 10.12.6 (16G24b) Studio 4.9.0.201705302345 Ti SDK 6.2.0.v20170901091533 Appc NPM 4.2.9 Appc CLI 6.2.4-master.9 Alloy 1.9.13 Xcode 8.3.3 (8E3004b) Events successfully fire and are caught in webviews using href links. Tested using the provided sample code, webview suite, and new webview checks
  5. Anthony Chung 2017-09-05

    I've tested this in production app, and the issue has been resolved. Great work.
  6. Eric Wieber 2017-09-06

    Verified in SDK builds 6.2.0.v20170906064110 & 7.0.0.v20170906103333

JSON Source