Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DFD799E9 for ; Tue, 13 Mar 2012 15:41:32 +0000 (UTC) Received: (qmail 24325 invoked by uid 500); 13 Mar 2012 15:41:31 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 24296 invoked by uid 500); 13 Mar 2012 15:41:31 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 24288 invoked by uid 99); 13 Mar 2012 15:41:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2012 15:41:31 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fil@adobe.com designates 64.18.1.33 as permitted sender) Received: from [64.18.1.33] (HELO exprod6og114.obsmtp.com) (64.18.1.33) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2012 15:41:24 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob114.postini.com ([64.18.5.12]) with SMTP ID DSNKT19qjraXHdVygAIdMDrxYsd8HbJwQdrZ@postini.com; Tue, 13 Mar 2012 08:41:03 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4b [10.128.4.237]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q2DFf1vq013263 for ; Tue, 13 Mar 2012 08:41:01 -0700 (PDT) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q2DFf0Pl021482 for ; Tue, 13 Mar 2012 08:41:01 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas03.corp.adobe.com ([10.8.189.121]) with mapi; Tue, 13 Mar 2012 08:41:00 -0700 From: Filip Maj To: "callback-dev@incubator.apache.org" Date: Tue, 13 Mar 2012 08:40:58 -0700 Subject: Re: Unified JS Contact object Thread-Topic: Unified JS Contact object Thread-Index: Ac0BL7AvXyj1fobbRB61BTch0YurUg== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.14.0.111121 acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I can't think of a reason to return the id unless people are doing webview-side caching of contacts or something along those lines=8A I wonder if that's done? Returning the contact object entirely may make sense (providing feedback, "Bob has been deleted"), but in most cases nested JS callbacks should also be able to handle this situation via closures. I'm indifferent as well... On 3/13/12 6:47 AM, "Becky Gibson" wrote: >I found another Contacts issue. The platforms have different return >values for contact.remove. There is no remove in the W3C spec but we felt >that removal should be supported so we added this api into the PhoneGap >Contact object. > >BB and iOS return the removed contact object, with its id set to null, in >the success callback. Android does not. We need to agree on this >behavior >and update as needed. The current documentation does not indicate what >is >returned in the success callback. > >In the unified JS only the id is passed to the remove function. This is >fine if we are only going to remove the contact and not pass anything back >in the success callback. However, iOS previously passed the entire >contact object into remove. The reason for this was so the contact object >could be easily returned without having to look it up in the address book >based on the id, then convert it to the proper format in order to return. > >Thus, if we return the contact object in the contact.remove success >callback, we should pass the entire contact object as the parameter. If >we >do not want to return anything in the success callback, we only need to >pass in the id. Whatever we decide it will be a change in behavior for >either Android or BB and iOS. I don't have a strong preference. It is >probably easier to return nothing in the remove success callback. Can >anyone think of reasons that the remove callback should return the removed >contact object? > > >-becky > > > >On Mon, Mar 12, 2012 at 2:56 PM, Filip Maj wrote: > >> Let's make the change and I can test it out on Android on my end - just >> ping me. >> >> On 3/12/12 10:22 AM, "Becky Gibson" wrote: >> >> >The unified JS contact object initializes the contact object >>incorrectly. >> >Base on the June, 2011 and March, 2012 definition for the contact >>object, >> > parameters that are not defined should have the initial value of null: >> > >> >All Contact >>objects * >> >must* include all attributes supported by the implementation, >>regardless >> >of >> >whether these attributes have been assigned a null value or not. If a >> >supported attribute has not been assigned a value by the user or the >> >implementation, then this attribute *must* still be present in the >> >resulting Contact >> >object >> >and *must* have a value of null. >> > >> >The current implementation initializes all of the array fields to an >>empty >> >array rather than null if no value is provided. The iOS code relies >>on >> >the distinction between null and empty array during an update of a >> >contact. >> > If an array value is null, that parameter is ignored (not changed), >>if it >> >is an empty array and data exists, the stored date for that parameter >>is >> >removed. >> > >> >Not sure if changing this back to the spec will affect the other >> >platforms? >> > >> >-becky >> >>