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 A22C49EC3 for ; Thu, 15 Mar 2012 23:32:59 +0000 (UTC) Received: (qmail 59785 invoked by uid 500); 15 Mar 2012 23:32:59 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 59749 invoked by uid 500); 15 Mar 2012 23:32:59 -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 59738 invoked by uid 99); 15 Mar 2012 23:32:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 23:32:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 23:32:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 499EC2228E for ; Thu, 15 Mar 2012 23:32:37 +0000 (UTC) Date: Thu, 15 Mar 2012 23:32:37 +0000 (UTC) From: "Filip Maj (Created) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <104148634.21976.1331854357303.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CB-344) Adding a new Contact associated to a Google Android account will fire error callback MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Adding a new Contact associated to a Google Android account will fire error callback ------------------------------------------------------------------------------------ Key: CB-344 URL: https://issues.apache.org/jira/browse/CB-344 Project: Apache Callback Issue Type: Bug Components: Android Affects Versions: 1.5.0 Environment: Android devices synchronized to a Google account. NOT AFFECTED: Android devices *not* synchronized to a Google account. Reporter: Filip Maj Assignee: Joe Bowser For Android devices sync'ed to a Google account, the native framework will end up, by default, creating and adding a new contact to the Google account. However, there is an issue with the current implementation. The way the Contact Manager class executes the {{save}} method, it [runs through the motions of saving, then when that completes, tries to retrieve the newly-created contact immediately|https://github.com/apache/incubator-cordova-android/blob/master/framework/src/org/apache/cordova/ContactManager.java#L91]. The issue arises when [checking for the newly-created contact|work/src/org/apache/cordova/ContactManager.java#L94]. What seems to be happening behind the scenes is there is a delay between when the contact is saved, and when the contact becomes available/searchable (possibly due to cloud synchronization with Google services?). Therefore, trying to retrieve the contact immediately after creating it generally causes the error callback to fail. This behaviour is exhibited in [the mobile-spec contact save() test|https://github.com/apache/incubator-cordova-mobile-spec/blob/master/autotest/tests/contacts.tests.js#L258-L284]. Interestingly enough, on a device that is *not* associated to a Google account, this test passes every time. Possibly worth investigating is whether contacts created and associated/saved to other types of accounts (Exchange?) exhibit the same problem. One naive workaround that I can think of is to {{sleep}} in a {{while}} loop inside the {{save}} method in ContactManager until the contact is found, and then fire off the appropriate callback. However we want to make sure the PluginManager fires off {{save}} executions on a separate thread for this, probably. -- 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