After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 349069 - e_book_async_get_contact() fails
e_book_async_get_contact() fails
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.0.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-07-28 11:10 UTC by Martyn Russell
Modified: 2018-12-11 07:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32



Description Martyn Russell 2006-07-28 11:10:27 UTC
When calling:

	result = e_book_async_get_contact (book, id, 
					   (EBookContactCallback) func, 
					   NULL);

where "id" is given by calling e_book_get_self() or any other legitimate "id" (in the format of "pas-id-4474A1EA00000000", the result does not evaluate as TRUE. There is no error condition returned here either so I don't know why. 

If I call e_book_async_get_contacts() instead and go through the list returned, I can easily match the E_CONTACT_UID to the owner of the book and find out the information I need, so I know the UID is correct.

Also, func is never called (which I guess is correct given the return value).

I have a test case if needed.
Comment 1 Ross Burton 2006-08-07 10:57:36 UTC
The API docs say this:

/**
 * e_book_async_get_contact:
 * @book: an #EBook
 * @id: a unique string ID specifying the contact
 * @cb: function to call when operation finishes
 * @closure: data to pass to callback function
 *
 * Retrieves a contact specified by @id from @book.
 *
 * Return value: %FALSE if successful, %TRUE otherwise
 **/

Now returning FALSE for success, TRUE for error is odd. Very odd.  Especially considering some of the other e_book_async_* functions return TRUE on success, and FALSE otherwise.
Comment 2 Kjartan Maraas 2010-12-16 18:17:15 UTC
This function was deprecated but it's replacement still does the same according to the api docs. The new one is called e_book_get_contact_async().
Comment 3 Milan Crha 2018-12-11 07:23:00 UTC
> Also, func is never called (which I guess is correct given the return value).

I guess it's because the async version requires a main loop (or the main context) to be running, because it's the place where the response is received.

>  * Return value: %FALSE if successful, %TRUE otherwise

The developer documentation is wrong, still, though the function doesn't need to return anything, because it's an asynchronous version. I fixed that with [1] for 3.31.4+ and 3.30.4+.

[1] https://gitlab.gnome.org/GNOME/evolution-data-server/commit/29ed6579a