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 761479 - Deleting VMs does not work when Boxes is closed shortly after deletion
Deleting VMs does not work when Boxes is closed shortly after deletion
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
: 755010 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-02-03 00:32 UTC by Michael Catanzaro
Modified: 2016-09-20 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screencast of bug (879.26 KB, application/octet-stream)
2016-03-26 16:10 UTC, Michael Catanzaro
Details

Description Michael Catanzaro 2016-02-03 00:32:31 UTC
I deleted a bunch of VMs with Boxes because I ran out of disk space. But the VMs remained under ~/.local/share/gnome-boxes/images.

Next time I reopened Boxes, they reappeared.
Comment 1 Michael Catanzaro 2016-02-03 00:38:10 UTC
I closed Boxes, reopened it, deleted all the VMs again, closed Boxes, reopened it, deleted all the VMs, four times; eventually it worked and the VMs stayed deleted.
Comment 2 Zeeshan Ali 2016-02-05 14:09:23 UTC
(In reply to Michael Catanzaro from comment #1)
> I closed Boxes, reopened it, deleted all the VMs again, closed Boxes,
> reopened it, deleted all the VMs, four times; eventually it worked and the
> VMs stayed deleted.

Is it possible this is a symptom of bug#751696 ?
Comment 3 Zeeshan Ali 2016-02-05 14:11:28 UTC
(In reply to Zeeshan Ali (Khattak) from comment #2)
> (In reply to Michael Catanzaro from comment #1)
> > I closed Boxes, reopened it, deleted all the VMs again, closed Boxes,
> > reopened it, deleted all the VMs, four times; eventually it worked and the
> > VMs stayed deleted.
> 
> Is it possible this is a symptom of bug#751696 ?

Although that sounds unlikely. Did you:

* dismiss the "box X has been deleted" notification?
* did you quit the UI immediately after dismissing the notification?
Comment 4 Michael Catanzaro 2016-02-05 14:43:24 UTC
(In reply to Zeeshan Ali (Khattak) from comment #3)
> Although that sounds unlikely. Did you:
> 
> * dismiss the "box X has been deleted" notification?

No.

> * did you quit the UI immediately after dismissing the notification?

Probably. Now I'm getting deja vu, did I report this before...? The answer is yes, in bug #755010. There are some other issues referenced in that bug as well, though.
Comment 5 Michael Catanzaro 2016-03-14 14:01:33 UTC
*** Bug 755010 has been marked as a duplicate of this bug. ***
Comment 6 Zeeshan Ali 2016-03-17 13:32:27 UTC
Thinking more about this, is it really the right thing to delete the VMs if user doesn't react to the 'Undo' notification? What if they change their mind and accidently quit Boxes?
Comment 7 Zeeshan Ali 2016-03-17 13:39:22 UTC
(In reply to Zeeshan Ali (Khattak) from comment #6)
> Thinking more about this, is it really the right thing to delete the VMs if
> user doesn't react to the 'Undo' notification? What if they change their
> mind and accidently quit Boxes?

Also what if while selecting boxes to delete, they select one (or two) they didn't actually want to delete and then in the panic to 'Undo' in time, they manage to quite Boxes. I can imagine that happening to me at least. :)
Comment 8 Jakub Steiner 2016-03-17 13:40:16 UTC
The undo pattern with in-app notification is precisely for that "i didn't mean to do that" moment. I don't consider the "trash" pattern where you go back to thing you deleted a week ago particularly interesting.
Comment 9 Zeeshan Ali 2016-03-17 13:49:18 UTC
(In reply to Jakub Steiner from comment #8)
> The undo pattern with in-app notification is precisely for that "i didn't
> mean to do that" moment. I don't consider the "trash" pattern where you go
> back to thing you deleted a week ago particularly interesting.

That is not what I was talking about at all. :) I was more concerned about two mistakes in a row, second one made in the panic of the first one. :)
Comment 10 Michael Catanzaro 2016-03-17 16:01:35 UTC
I'm pretty sure that if you delete a couple boxes, fail to press Undo, then quit the app, the boxes should stay deleted. It's super confusing for them to reappear.
Comment 11 Zeeshan Ali 2016-03-23 13:49:51 UTC
Fixed in master. I'll cherry-pick it for 3.20.1. If you could test it out a bit, that would be lovely.

----------
commit: 5dceb3091d2ea5fa1d6fea7f8b7b813937fa6e24

    app: Minor formatting fix
    
    Line was going beyond 180 chars.
    
commit: f88ac9ed8cf2c2cb0bcc7549550d471ac12cdc85

    notification: CancelFunc -> DismissFunc
    
    Rename CancelFunc to DismissFunc as not is the new name more
    appropriate, the 'Cancel' give the complete opposite idea to what it
    actually does in some cases, e.g deletion notification.

commit: 2a32fe6dbd51d7f17375f084960fc5f38032a308

    notificationbar: cancel() -> dismiss_all()
    
    Just a more appropriate name for this method since it dismisses
    notifications.
    
commit: 7cc0eacc1359afa4e3721d31d0910020d458d795

    Add AsyncLauncher class
    
    Add a singleton that will be responsible for launching tasks in threads
    and then keep track of all launched threads so that at application exit,
    we can wait for all threads to finish.

commit: 5f5508c66a39960c7b45f0998bccdc0fcb6021dd

    Make use of new AsyncLauncher API
    
    This, combined with previous patches, fixes the issue of boxes not
    actually getting deleted if user exits Boxes quickly after deleting the
    boxes.
    
commit: ae337cc2fcd917b2907eea2085334e1e28eed987

    util: Drop now redundant run_in_thread()
Comment 12 Michael Catanzaro 2016-03-26 16:10:31 UTC
Created attachment 324800 [details]
screencast of bug

(In reply to Zeeshan Ali (Khattak) from comment #11)
> Fixed in master. I'll cherry-pick it for 3.20.1. If you could test it out a
> bit, that would be lovely.

Still broken with today's git master. Screencast attached.
Comment 13 Zeeshan Ali 2016-03-29 15:26:28 UTC
(In reply to Michael Catanzaro from comment #12)
> Created attachment 324800 [details]
> screencast of bug
> 
> (In reply to Zeeshan Ali (Khattak) from comment #11)
> > Fixed in master. I'll cherry-pick it for 3.20.1. If you could test it out a
> > bit, that would be lovely.
> 
> Still broken with today's git master. Screencast attached.

Yeah, i can reproduce it here too. Really weird, I did test multiple times before pushing the patches.. :(
Comment 14 Zeeshan Ali 2016-03-29 15:28:43 UTC
Ah, ok. Seems the fix is unreliable since I can't reproduce 100% of the times.
Comment 15 Zeeshan Ali 2016-03-29 17:21:29 UTC
commit: 1375c8dfe3d2b0db821cc68b41c867cd0c947c7c

    app: Simply quit() on removal of main window
    
    Our shutdown() implementation needs to cleanup/shutdown all windows and
    it won't do that if we already remove the main window from the list
    of all the windows (that shutdown() iterates over) before launching the
    shutdown process.
    
    This fixes the issue of notifications not getting dismissed (and hence
    deletion of boxes not happning for deletion notifications) if user quits
    Boxes by pressing the 'x' button in the titlebar, instead of Ctrl+q
    shortcut.