You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Olivier Louvignes (Created) (JIRA)" <ji...@apache.org> on 2012/02/18 16:40:59 UTC

[jira] [Created] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

deviceContact.save() seems to crash with empty Arrays for specific fields.
--------------------------------------------------------------------------

                 Key: CB-262
                 URL: https://issues.apache.org/jira/browse/CB-262
             Project: Apache Callback
          Issue Type: Bug
          Components: iOS
    Affects Versions: 1.4.0
         Environment: IOS5 XCODE4.3
            Reporter: Olivier Louvignes
            Assignee: Shazron Abdullah


Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.

So i used :

				// Force arrays
				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
				if(!deviceContact.emails) deviceContact.emails = [];
				if(!deviceContact.addresses) deviceContact.addresses = [];
				if(!deviceContact.urls) deviceContact.urls = [];
				if(!deviceContact.organizations) deviceContact.organizations = [];
				if(!deviceContact.ims) deviceContact.ims = [];


However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Shazron Abdullah (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-262:
--------------------------------

    Fix Version/s: 1.6.0
    
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>             Fix For: 1.6.0
>
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Brian LeRoux (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian LeRoux updated CB-262:
----------------------------

    Fix Version/s:     (was: 1.6.0)
                   1.7.0
    
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>             Fix For: 1.7.0
>
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-262.
---------------------------------

    Resolution: Cannot Reproduce

Tried this sample code, could not repro the crash:

{code}
	function onBodyLoad()
	{		
		document.addEventListener("deviceready", onDeviceReady, false);
	}

    function onDeviceReady()
    {
        var options = new ContactFindOptions();
        options.filter=""; 
        var fields = ["displayName", "name"];
        navigator.contacts.find(fields, onSuccess, onError, options);
    }
        
    function onSuccess(contacts) {
        console.log('Found ' + contacts.length + ' contacts.');
        
        for(var i=0; i < contacts.length; ++i)
        {
            console.log(JSON.stringify(contacts[i]));
            
            if(!contacts[i].phoneNumbers) contacts[i].phoneNumbers = [];
            if(!contacts[i].emails) contacts[i].emails = [];
            if(!contacts[i].addresses) contacts[i].addresses = [];
            if(!contacts[i].urls) contacts[i].urls = [];
            if(!contacts[i].organizations) contacts[i].organizations = [];
            if(!contacts[i].ims) contacts[i].ims = []; 
            
            contacts[i].save(winSave, failSave);
        }
    };
        
    function onError(contactError) {
        alert('onError!');
    };
    
    function winSave() {
        alert("Save success");            
    }
        
    function failSave(contactError) {
        alert("Error = " + contactError.code);
    }

{code}
                
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>             Fix For: 1.7.0
>
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Shazron Abdullah (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227750#comment-13227750 ] 

Shazron Abdullah commented on CB-262:
-------------------------------------

Hi,
Can you provide some sample code that demonstrates the crash? Thanks.
                
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>             Fix For: 1.6.0
>
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Shazron Abdullah (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-262:
--------------------------------

    Priority: Critical  (was: Major)
      Labels: contacts crash ios  (was: contacts ios)

Crash issues should always be > major prio
                
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-262) deviceContact.save() seems to crash with empty Arrays for specific fields.

Posted by "Becky Gibson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13215972#comment-13215972 ] 

Becky Gibson commented on CB-262:
---------------------------------

nulls have a special meaning in the Contact object, please check in the W3C spec (sorry, can't remember all the details off the top of my head ATM).  However, I do agree that it shouldn't crash when you provide bad input so will look into it for 1.6.
                
> deviceContact.save() seems to crash with empty Arrays for specific fields.
> --------------------------------------------------------------------------
>
>                 Key: CB-262
>                 URL: https://issues.apache.org/jira/browse/CB-262
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: IOS5 XCODE4.3
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: contacts, crash, ios
>
> Tried to avoid any null parameters in the deviceContact returned from navigator.contacts.find() operation.
> So i used :
> 				// Force arrays
> 				if(!deviceContact.phoneNumbers) deviceContact.phoneNumbers = [];
> 				if(!deviceContact.emails) deviceContact.emails = [];
> 				if(!deviceContact.addresses) deviceContact.addresses = [];
> 				if(!deviceContact.urls) deviceContact.urls = [];
> 				if(!deviceContact.organizations) deviceContact.organizations = [];
> 				if(!deviceContact.ims) deviceContact.ims = [];
> However this does make PG crash on the next save.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira