Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17021] Analytics: Feature event crashes app if you send a String and a String on iOS

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-05-22T20:36:52.000+0000
Affected Version/sRelease 3.3.0
Fix Version/s2014 Sprint 10, 2014 Sprint 10 SDK, Release 3.3.0, Release 3.4.0
ComponentsiOS
Labelsmodule_analytics, qe-3.3.0, qe-testadded
ReporterSamuel Dowse
AssigneeSabil Rahim
Created2014-05-22T18:16:59.000+0000
Updated2014-05-30T17:00:52.000+0000

Description

Description

Sending a feature event with two strings crashes the iOS application. This used to work using 3.2.3.GA

Steps To Reproduce

1. Use the following code snippet
var window = Ti.UI.createWindow({
    backgroundColor: 'white',
    layout: 'vertical'
});
var button = Titanium.UI.createButton({
   title: 'Send Feature Event',
   top: 10,
   width: Ti.UI.SIZE,
   height: 50
});
button.addEventListener('click',function(e)
{
   Ti.API.info("Sending Feature Event");
   Ti.Analytics.featureEvent('featureEvent', 'featureEvent.testButton');
   
});
 
window.add(button);
window.open();
2. Click on the button.

Expected Result

App should send the feature event

Actual Result

App crashes

Comments

  1. Sabil Rahim 2014-05-22

    Extended Code Sample
       var window = Ti.UI.createWindow({
           backgroundColor: 'white',
           layout: 'vertical'
       });
       var jsonString = {"key1":"value1","Key2":"value2"};
       
       var b1 = Titanium.UI.createButton({
          title: 'Send Feature Event string:',
          top: 10,
          width: Ti.UI.SIZE,
          height: 50
       });
       b1.addEventListener('click',function(e)
       {
          Ti.API.info("Sending Feature Event");
          Ti.Analytics.featureEvent('featureEvent', 'featureEvent.testButton');
           
       });
         
       var window = Ti.UI.createWindow({
           backgroundColor: 'white',
           layout: 'vertical'
       });
       var b2 = Titanium.UI.createButton({
          title: 'Send Feature Event Jsonstring:',
          top: 10,
          width: Ti.UI.SIZE,
          height: 50
       });
       b2.addEventListener('click',function(e)
       {
          Ti.API.info("Sending Feature Event Jsonstring:");
          Ti.Analytics.featureEvent('featureEvent', JSON.stringify(jsonString));
           
       });
       var window = Ti.UI.createWindow({
           backgroundColor: 'white',
           layout: 'vertical'
       });
       var b5 = Titanium.UI.createButton({
          title: 'Send Feature Event JSON:',
          top: 10,
          width: Ti.UI.SIZE,
          height: 50
       });
       b5.addEventListener('click',function(e)
       {
          Ti.API.info("Sending Feature Event");
          Ti.Analytics.featureEvent('featureEvent', jsonString);
           
       });
       var b3 = Titanium.UI.createButton({
          title: 'Send Feature Event OBJECT:',
          top: 10,
          width: Ti.UI.SIZE,
          height: 50
       });
       b3.addEventListener('click',function(e)
       {
          Ti.API.info("Sending Feature Event");
          Ti.Analytics.featureEvent('featureEvent', b1);
           
       });
       
       var b4 = Titanium.UI.createButton({
          title: 'Check Last Event',
          top: 10,
          width: Ti.UI.SIZE,
          height: 50
       });
       b4.addEventListener('click',function(e)
       {
          Ti.API.info("Last Event ? " + Ti.Analytics.lastEvent);
          alert(Ti.Analytics.lastEvent);
           
       });
       window.add(b1);
       window.add(b2);
       window.add(b3);
       window.add(b5);
       window.add(b4);
       window.open();
       
  2. Sabil Rahim 2014-05-22

    https://github.com/appcelerator/titanium_mobile/pull/5728
  3. Sabil Rahim 2014-05-22

    3_3_X : https://github.com/appcelerator/titanium_mobile/pull/5729
  4. Samuel Dowse 2014-05-30

    Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201405271647 Titanium SDK, build: 3.3.0.v20140528144113 Titanium CLI, build: 3.3.0-beta Alloy: 1.4.0-beta iOS Device: iPhone 5S (7.1.1) App no longer crashes and analytical data is sent. Closing.

JSON Source