Thanks Daniel. Slightly different circumstances, as my is a new contact, not an updated one, but it looks like the same underlying issue. Unfortunately I cannot wait for an ETag change, because the contact is new - I can't see the ETag updating once the contact is created. Waiting for 1 minute would mean it could take 2 hours to sync 120 contacts, unless I set up a workerthread to upload the pictures - God know what race conditions I'll see then.
"Check the new ETag, wait around 1 minute, and retry few times if it fails" - OUCH! I hope this is fixed soon. Martin On Dec 17, 10:00 am, dflorey <[email protected]> wrote: > See: > > http://groups.google.com/group/google-contacts-api/browse_thread/thre... > > On Dec 16, 11:37 pm, martinlong1978 <[email protected]> wrote: > > > > > I'm using the .NET api now, although I've seen exactly the same > > through the Java API, so it would suggest this is a server issue. > > > When I create a contact there is some kind of race condition, meaning > > that _sometimes_ (about 1 in 3) I cannot upload an image for that > > contact. > > > To create the contact: > > > Uri feedUri = new Uri > > (ContactsQuery.CreateContactsUri("default")); // This appears to be > > redundent > > Feed<Contact> feed = cr.GetContacts(); > > entry = cr.Insert(feed, entry); > > updatePicture(); > > > To upload the photo: > > > // I've tried up to a 1 min delay before this. > > entry = cr.Update(entry); > > Console.WriteLine(entry.PhotoUri); > > cr.SetPhoto(entry, photoStream); > > > I get a GDataRequestException: > > > {"Execution of request failed: > > http://www.google.com/m8/feeds/photos/media/[email protected]/20d591310a37df9d"} > > > {"The remote server returned an error: (404) Not Found."} > > > However, when I query the feed, it's there, I get: > > > <entry> > > <id>http://www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/ > > base/20d591310a37df9d</id> > > <updated>2009-12-16T22:28:40.737Z</updated> > > <category scheme='http://schemas.google.com/g/2005#kind'term='http:// > > schemas.google.com/contact/2008#contact'/> > > <title type='text'>xxxxxxx</title> > > <content type='text'></content> > > <link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' > > type='image/*' href='http://www.google.com/m8/feeds/photos/media/ > > testuser%40longhome.co.uk/20d591310a37df9d/1B2M2Y8AsgTpgAmY7PhCfg'/> > > <link rel='self' type='application/atom+xml' > > href='http://www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/ful......> > > <link rel='edit' type='application/atom+xml' > > href='http://www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/ful......> > > <gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>+ > > +44xxxxxxxxx</gd:phoneNumber> > > </entry> -- You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en.
