If you receive a call while you are typing a message, the draft is not saved when Delta Chat's activity is stopped and replaced with the incoming call activity.
Can't reproduce, works on my phone.
@adbenitez Could you test if this problem is still present? Might have been fixed in one of the recent cleanup actions.
@adbenitez Could you test if this problem is still present? Might have been fixed in one of the recent cleanup actions.
yup, still alive
@r10s sometimes??? it is always for me, is this happening randomly in your device???
EDIT: forget it, it is because it works on angelo-fuchs is device, sorry...
I can't reproduce this on my phone, someone else needs to pick this issue up.
Actually I recommend to close it, I just realized this is happening because my phone is a low mem device, when I minimize an app and open another, the minimized app is killed by the system to save RAM, this happens even if I disable battery optimization for that app, when I have an incoming call, the delta chat view is destroyed right away when the dialer activity is shown
thanks for the hint with the low RAM, i think i've found the problem in the code:
we save the draft on onNewIntent() (we're reusing intents which may be another problem, see #419) and not in onPause().
@adbenitez i will do a pr to fix this and also attach an APK for testing to that
wow thanks! :)
not totally sure if the pr fixes the problem, save-draft is also done in onDestroy() which should also be called in your low-ram situation.
it worked in one test, I will test this several times latter, but at first glance seems good!! +1
great, thanks for testing, i think we can merge this then, should not hurt to save the draft a bit sooner.
bad news it didn't worked in further tests, perhaps was an error in my first test that I saved the draft accidentally.
Also did some tests with k9 mail and also drafts are lost, so it is not Delta Chat only, perhaps this don't worth your time.
hm, seems as if the foreground app is completely killed on the low-memory device when another app comes to foreground.
we were saving the draft in onDestroy() and the pr did the saving a bit sooner in onPause(), so it might be that it gets mitigated a bit, but, it's hard to work against the os wants to kill us ;(
i think if we get more reports on this issue, we can re-target it, maybe by saving the draft every some seconds in a timer or so.
yes, I am fine with this closed. If the OS is killing us lets just rest in peace ;)
(as a workaround I can avoid this by pressing the back button to force to save de draft before the app is put on background)
as mentioned, if we encounter this being a more common problem, we can try work arounding this.
but as you mentioned, k-9 has the same problem, and also signal has it, so, it's more the os.
Most helpful comment
great, thanks for testing, i think we can merge this then, should not hurt to save the draft a bit sooner.