Bug 64835 - Add RemoveAddressBook Feature
Summary: Add RemoveAddressBook Feature
Status: RESOLVED MOVED
Alias: None
Product: SyncEvolution
Classification: Unclassified
Component: PIM Manager (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium enhancement
Assignee: SyncEvolution Community
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 56141
  Show dependency treegraph
 
Reported: 2013-05-21 17:36 UTC by Eugenio Parodi
Modified: 2018-10-13 12:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Eugenio Parodi 2013-05-21 17:36:50 UTC
It would be useful to have something like:
 	RemoveAddressBook
That will remove the addressbook synced if available (as RemovePeer do) 
but keep the peer definition retrievable via GetAllPeers.
Comment 1 Patrick Ohly 2013-05-22 07:05:45 UTC
I would prefer a slightly more general API, one which will also work once (if) we cache more than just contacts. Proposal:

    void RemovePeerData(string uid, list of strings)

         Removes cached data of the given peer. In contrast to
         RemovePeer(), the configuration of the peer and is left
         unchanged. As in RemovePeer(), its address book is
         automatically deactivated in the unified address book if was
         active before removing it.

         An empty list removes all data. "contacts" removes only the
         address book.

Okay? That call would try to completely remove the EDS database file. It might fail if the database is in use (not sure whether EDS then fails to remove or the other users fail).

I was also considering a PurgePeer() call instead, which would have only removed the contacts inside the database. The advantage would be that it is less intrusive if there are other users of the DB (sync, windowed search). The disadvantage is that it is less thorough.

Which one do you prefer?
Comment 2 Patrick Ohly 2013-05-22 07:48:02 UTC
Hmm, I ran a test and noticed that e_source_remove(), the method used to remove an EDS database, does not remove the local database file immediately. Instead it relies on a garbage collector to remove the obsolete local data.

I'll check with the upstream developers to see how an immediate removal can be accomplished.
Comment 3 Patrick Ohly 2013-05-24 07:45:28 UTC
(In reply to comment #2)
> Hmm, I ran a test and noticed that e_source_remove(), the method used to
> remove an EDS database, does not remove the local database file immediately.
> Instead it relies on a garbage collector to remove the obsolete local data.
> 
> I'll check with the upstream developers to see how an immediate removal can
> be accomplished.

This is intentional: upstream EDS garbage-collects the database files once per day, then moves them into a "trash" folder and removes them permanently after a month.

This is not the behavior that we want when removing via the PIM Manager API (RemvoePeer or RemovePeerData), so I added code to remove the files right away. I also added a new testpim.py test, TestContacts.testRemove.

I have not implemented RemovePeerData() itself - for that I am still waiting for confirmation about the API.
Comment 4 Patrick Ohly 2013-09-30 11:26:33 UTC
Eugenio, do you still need the new RemovePeerData() API?
Comment 5 Eugenio Parodi 2013-10-01 10:29:48 UTC
Hi Patrick.
At this stage it is no more required.
But It may be requested again in the next release (q3 2014).
Comment 6 Patrick Ohly 2013-10-01 10:38:28 UTC
Okay, putting this on hold, to be reprioritized and assigned in the future.
Comment 7 Patrick Ohly 2013-11-28 16:28:39 UTC
Eugenio, should we schedule this new API for inclusion in 2014?
Comment 8 GitLab Migration User 2018-10-13 12:44:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/SyncEvolution/syncevolution/issues/131.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.