When we close the app after typing something in the message box, the message is not saved in drafts.
Same steps reproduced in webapp seem to store the message in drafts perfectly.


@zulipbot label "Type: Bug"
I can't reproduce this on my macOS desktop app. I highly doubt the issue has anything to do with the desktop app since I have seen the draft not being saved issue in webapp a couple of time also though can't reproduce this now.
@akashnimare i have tested it multiple times and i think it is an existent issue on Ubuntu. @abhigyank can you please test and tell if this is the case for you or not ?
The webapp attempts to save the draft content during close using a beforeunload event listener. My guess is that depending how forcibly you quit the app, that code may or may not get to finish running before the app closes, so this autosave method might not be 100% reliable.
i can reproduce this on Ubuntu
@timabbott is there anything we could do for this in the web app?
If we can reproduce this, what I'd try is e.g. adding some sort of logging statement statement in that beforeunload to see if it's not being called by the browser, or it's being called but failing. I guess I'm not sure what the right process there is because one is quitting the app.
I would also definitely read through these Google results to see if any of the suggestions there help; a few seem potentially relevant but it's hard for me to tell without testing https://www.google.com/search?q=electron+quit+app+beforeunload&oq=electron+quit+app+beforeunload
@vsvipul can you test this against master? I think https://github.com/zulip/zulip-desktop/pull/783 should fix this.
@akashnimare will test it right now. Didn't get any notification for this message.
@akashnimare Works fine for me now. This issue can be closed. Great work @priyank-p !!
Closing since it's definitely same as #767 and is fixed in master.