Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10853] iOS: Ti.App.Properties "change" event should not fire when setting an existing property to its current value

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-19 API
ComponentsiOS
Labelsapi, module_app_properties, parity, qe-testadded
ReporterHieu Pham
AssigneeHieu Pham
Created2012-09-11T16:14:15.000+0000
Updated2013-08-13T11:05:44.000+0000

Description

1. Run this code
var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});
 
function onPropertiesChange()
{
   
    Ti.API.info('change fired')
    Ti.App.Properties.setBool('test', true);
    Ti.App.Properties.setDouble('test1', 2.5);
    Ti.App.Properties.setInt('test2', 45);
    Ti.App.Properties.setString('test3', "hello");
}
     
Ti.App.Properties.addEventListener('change',onPropertiesChange);

Ti.App.Properties.setBool('test', true);
Ti.App.Properties.setDouble('test1', 2.5);
Ti.App.Properties.setInt('test2', 45);
Ti.App.Properties.setString('test3', "hello");
  
win.open();
2. Look at log and observe infinite loop. On Android, "change" is only called 4 times. Expected Behavior: - "change" should only be called 5 times - since iOS also adds appGUID when launching the app for the first time.

Comments

  1. Satyam Sekhri 2012-12-06

    The change is fired 4 times on Android and 5 times on iOS. Verified on: Titanium Studio: 3.0.0.201211301903 Titanium SDK:3.0.0.v20121204181658 Device: Nexus 7 (Android v4.1), iOS Simulator (v6.0), iPad2 (v5.1) XCode: 4.5.1
  2. Anshu Mittal 2013-08-13

    Tested with: SDK: 3.1.2.v20130812225629 Appcelertaor Studio: 3.1.2.201308091728 OS: OSX 10.8.4 Device: iPhone5(v 6.1.4) Xcode: 4.6.3 Change event is fired 4 times on iOS whereas it should be fired 5 times since iOS also adds appGUID when launching the app for the first time

JSON Source