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 731491 - Geary displays "Do you want to discard this message?" on exit
Geary displays "Do you want to discard this message?" on exit
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: composer
master
Other Linux
: High normal
: ---
Assigned To: Geary Maintainers
Geary Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-11 00:02 UTC by Adam Dingle
Modified: 2017-11-20 15:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Adam Dingle 2014-06-11 00:02:12 UTC
Ever since we landed the inline composer, when I exit Geary I occasionally see a dialog with this:

  "Do you want to discard this message?"

This appears even though I currently have no composer window open.  I don't have a reproducible case for this, but have seen this happen many times.
Comment 1 Adam Dingle 2014-06-11 00:03:19 UTC
In fact, sometimes I have to click Discard several times to get through a series of such dialogs before Geary will exit.
Comment 2 Robert Schroll 2014-06-11 06:09:33 UTC
One possibility is that composers are getting "lost", being hidden instead of being closed when changing conversations or folders.  If you notice cases where you're not prompted about closing a composer when you should be, please note it here.
Comment 3 Adam Dingle 2014-06-12 01:26:23 UTC
I still see this bug all the time - several times per day at least.  Unfortunately I still have no reproducible case.

Are you guys seeing this too?  If you'd like to add debug logging that could help pinpoint the problem, I'd be happy to run with logging on and send you the log the next time I see this.
Comment 4 Jim Nelson 2014-06-12 01:50:32 UTC
I did see this today.  I don't know what I did to trigger it.  I just now tried a few simple test cases to repro it (create a new message + exit, reply + exit, new message + change folder, etc.) to no avail.

I do recall seeing this before, but the problem is, we were seeing this during the development of the inline composer and Robert fixed the more egregious cases.  I don't recall if I saw this happen after the final patches landed.

Robert, if you can think of some debugging that might help here, please feel free to commit them to master for Adam.
Comment 5 Robert Schroll 2014-06-12 05:55:49 UTC
I haven't seen this problem, but I'll keep an eye out.  I'm worried that there's an asynchronous close that isn't actually finishing, leaving us with a composer hanging around that we thought got closed.

Perhaps we can add a little debugging display that shows the number of open composers being tracked, so we can try to see when it diverges from the number that we see.
Comment 6 Robert Schroll 2014-06-12 17:08:24 UTC
I've added two debug statements that should print when composers are created and destroyed.  You can check that you get the destroy message whenever you close a composer (whether saved, discarded, or sent).  If you can figure out when you don't get that message, then we can track down where the composer is getting lost.
Comment 7 Adam Dingle 2014-06-12 23:38:35 UTC
OK.  Do you recommend that I run Geary with --debug, or with some of the --log options (which?)
Comment 8 Jim Nelson 2014-06-12 23:45:58 UTC
--debug is all you need to do.
Comment 9 Robert Schroll 2014-10-20 03:15:14 UTC
I've found a way that composers can get lost, although I get the discard message dialog when switching conversations:

When we're indexing the conversations after opening Geary, the UI semi-freezes.  Notably, no composers show up when you reply to a message, but they are actually created.  If you switch conversations before the indexing ends, you get the large spinner.  When the indexing end, we end up in a confused state.  I had opened two composers in a test -- the first popped up, but I got two close dialogs when I tried to get rid of it.
Comment 10 Jim Nelson 2014-10-23 21:52:54 UTC
Gah.  The problem is the re-indexing causes the database to lock out all other transactions.  What's probably happening is the composer is performing some async I/O (i.e. opening the Drafts folder), the async request hangs in limbo, then the composer is destroyed before being presented.

If everything else is working (knock on wood), a Cancellable should be set to cancelled when the user changes conversations.  Presumably the composer could monitor that Cancellable as well and use that to tear down properly.  At least, that's my initial though process on all this.
Comment 11 Jim Nelson 2014-10-24 00:30:45 UTC
I believe the long database pause at startup is vanquished in master (bug #725929).  Does that solve this problem?  Even if it does, we may be just hiding the underlying issue, or at least making it more difficult to be triggered.
Comment 12 Adam Dingle 2014-10-24 02:44:00 UTC
I haven't seen this occur in quite a while now, actually.
Comment 13 Jim Nelson 2014-10-24 17:58:17 UTC
Robert, correct me if I'm wrong, but you found a couple of code paths after Adam reported this that could trigger this bug.  (Archive when a composer is open, or something like that?)  So it could be that the problem Robert described in comment #9 is the last way to trigger this.
Comment 14 Robert Schroll 2014-10-24 18:24:11 UTC
The archiving bug is still open at bug #730606.  And I suspect there may be ways to get composers lost in the drafts folder, given bug #739141.  So I wouldn't prepare the victory party quite yet.
Comment 15 Michael Gratton 2017-11-20 15:06:43 UTC
I haven't seen this since the draft management reworking went in for 0.12, so I'm going to resolve this as fixed. Do reopen it if you see it again.