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 657974 - support undoing delete
support undoing delete
Status: RESOLVED WONTFIX
Product: folks
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks: 657975
 
 
Reported: 2011-09-01 17:37 UTC by Alexander Larsson
Modified: 2011-09-02 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Larsson 2011-09-01 17:37:25 UTC
I want to add undo of delete operations in gnome-contacts, as its a pretty destructive operation. I can do so by making a copy of the folks data, but then i I restore the contact I will not get back any data on the backend that is not accessible by folks. So, ideally this kind of operation should get some help on the backend side.

Do you think this is possible?
Comment 1 Philip Withnall 2011-09-01 18:57:51 UTC
(In reply to comment #0)
> I want to add undo of delete operations in gnome-contacts, as its a pretty
> destructive operation. I can do so by making a copy of the folks data, but then
> i I restore the contact I will not get back any data on the backend that is not
> accessible by folks. So, ideally this kind of operation should get some help on
> the backend side.
> 
> Do you think this is possible?

Original answer (see the bottom of the comment for a different answer which involves folks people doing less work):

Not for 3.2 (if I may be so bold).

It definitely can't be supported cleanly by some backends, such as Telepathy, since if you delete an IM contact, the person on the other end will have to agree to re-adding you for the deletion to be undone.

It could be supported cleanly on trivial backends like key-file.

I guess it could be supported cleanly on backends like eds and Tracker if, before deleting the persona, folks grabbed all the information it could (even stuff it couldn't understand) about that persona. For example, for eds it could export a full vCard of the contact into memory. Folks could then return some kind of handle for this data to gnome-contacts as part of the undoable-deletion operation. If the user decides they want to undo the deletion, gnome-contacts could pass the handle back to folks, which could re-add the personas using the data it saved earlier.

I can't think of a clean way around the Telepathy problem, though. I guess the best we could do is to only add an UndoableDeletion interface to PersonaStores which support it (i.e. _not_ Tpf.PersonaStore). gnome-contacts could then display a really, really big question dialogue before deleting individuals containing personas from stores which don't implement this interface, giving the user the option to:
 • Delete all personas (without the option to undo)
 • Delete all personas except the ones which can't be un-deleted (leaving the option of undoing the deletion for the other personas)
 • Run away

This all feels icky and unstable.



Different answer:

How about solving the problem entirely in gnome-contacts, by only actually deleting personas 5 minutes (or so) after the user presses “delete”?

I'd guess that most times people click “undo” are almost immediately after pressing “delete” by accident (in this scenario, anyway; the undo stack in GIMP is a different use case). It would be reasonable for changes to only propagate after 5 minutes (people are used to this kind of weak consistency from web services already), and I'm willing to bet it would cover 99% of the cases where people would want to undo deleting a contact.

For example, this is what GMail does with its undo functionality for sending e-mails (http://gmailblog.blogspot.com/2009/03/new-in-labs-undo-send.html).
Comment 2 Alexander Larsson 2011-09-02 08:04:35 UTC
In fact, the UI mockup had undo as only availible directly after deleting the contact, so we could just hide it temporarily in contacts itself and then do the delete later. It would mean the contact would be visible in all other apps using folks though, but that is not really a problem i guess.
Comment 3 Philip Withnall 2011-09-02 16:55:15 UTC
Closing as WONTFIX then. :-)