deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.15k stars 149 forks source link

lost draft, again #2184

Closed cauerego closed 2 years ago

cauerego commented 2 years ago

Screenshot_20220105-132734

deltachat-log-20220105-132159.txt

the last time this happened, support told me it was a known bug when delta chat was called from another application.

i never relied on that ever since...

looks like i should not rely on delta chat, period!

this is unacceptable.

gerryfrancis commented 2 years ago

@cauerego Thank you for your report.

looks like i should not rely on delta chat, period!

this is unacceptable.

Yes, indeed, but to troubleshoot the issue any further please use the latest version of Delta Chat for Android, currently 1.26.2, try again, and report back, please. It is quite difficult to nail down an issue that probably no longer occurs in the latest app version. I remember almost the same bug that occured in a very old build about one year ago, but it seems that one of the latest updates fixed the issue.

However, thanks in advance for your understanding, and sorry for the circumstances!

cauerego commented 2 years ago

my bad. in over 20 years used to always keep everything up to date, i now forget i don't do that anymore for the past months, perhaps over a year now.

too many updates are failing. too many updates being requested by too many apps.

but, indeed, i don't recall if the last time i contacted support was over 6 months ago (the maximum time when my version was updated).

i just updated it now...

thanks for cooling down...

however...

disappearing drafts should never, ever happen on a device that have its own battery!

i would like to understand why this happens, technically, why it was an overlooked issue, and how it was fixed (supposing it was fixed).

my great fear is that the devs still don't really know, as this wasn't even mentioned in the patch notes.

this is a huge bug, it should be noted on the patch notes if it was fixed... and ideally, how it was fixed!

gerryfrancis commented 2 years ago

thanks for cooling down...

@cauerego Never mind, we all are people of good will. :)

I have been looking into your DC log, maybe there is a problem in detecting your drafts folder, as its name is just draft. Does/did it make a difference whether these disappearing drafts were initially composed with DC or other mail apps? Some other clients might not set the \Draft message flag, also your folder draft might not carry the \Drafts folder flag to let DC know that this is the drafts folder.

This PR was merged in core version 1.57.0, and your DC for Android version 1.20.5 does not have this fix, yet: https://github.com/deltachat/deltachat-core-rust/pull/2489

So, please report your experience with the current version, thanks in advance!

Hocuri commented 2 years ago

This was a bug in Android, not Core, which I fixed sometime ago, the reason why this bug was there is quite complicated.

So, this bug can be closed I think, thanks for taking care everyone:heart:! (If you have another bug in the newest version, it's better to open a new issue).

cauerego commented 2 years ago

let's take @Hocuri gut feeling on this...

but, please, do share details. i want to know exactly why this bug existed!

Hocuri commented 2 years ago

https://github.com/deltachat/deltachat-android/pull/1770

gerryfrancis commented 2 years ago

@Hocuri The PR you have mentioned was merged on Feb 5th, 2021. The official version 1.20.5 of DC for Android was built on Jun 7th, 2021, so I am not sure that this PR is related.

Hocuri commented 2 years ago

@gerryfrancis lol yes you're right...

Still, lots of things happened since 1.20.5 and the bug may as well be gone. @cauerego if this issue happens again with the recent version of Delta Chat, please do tell us! You're right that this is a pretty severe bug, so even if it's rare, we should try to tackle it down.

I think that it makes more sense to open a new issue and summarize the few things we know, than re-opening this issue here. Because we talked a lot about various stuff here, and if someone wants to know what the issue is about, they would have to read all of it. It's cleaner to have a new issue, then (you can link to this issue here).

cauerego commented 2 years ago

happened twice more now.

i create 2 simple drafts and leave there.

after a few days, they all disappear.

in fact, it looks like an entirely different bug, and somewhat much worse.

i can never trust drafts on delta ever again unless i get a very good explanation on what's happening and perhaps even then i'll need a new ux. 😭

(feel like i should give it up and stick with the fediverse, as i should have done already.)

gerryfrancis commented 2 years ago

@cauerego Is it possible to submit such an (anonymized) draft to this issue here so we can run some tests? Thanks in advance!

r10s commented 2 years ago

after a few days, they all disappear.

moreover, if would be interesting if you can say if the chatlist shows the summary "Draft: ..." in between these "few days" - we could then say if saving or loading failed.

also - did you interact somehow with the chat between the "few days"? so opening in Delta Chat - but also sharing to the chat or tapping a mailto: link opening the chat in question.

Hocuri commented 2 years ago

Did you maybe hit "share" in another app, selected DeltaChat and then selected the chat where the draft disappeared?

Because, when you share to a chat, the draft there is overwritten - other messengers do this, too.

cauerego commented 2 years ago

draft data was literally short random strings. such as "hi" or "x". sometimes i do this to bump up a chat conversation and work as a reminder for later.

(a list of open drafts would complete this undocumented feature as perfect for me.)

yes, all other details should be obvious from this:

if a draft is to be unexpectedly overwritten, i would expect to see a notification and a new draft. neither ever happened to me in my whole delta chat experience.

cauerego commented 2 years ago

while trying to replicate the issue, i got it in a few minutes!

Screenshot_20220203-060420

my first draft was to stallman. by the time of the 3rd draft, stallman's was lost. then i did it again (with different wording) for the screenshot.

also saved the logs. let me know if i should include them.

hpk42 commented 2 years ago

Thanks for the report and screenshot. Yes, if you could send the log to @.*** that would be appreciated. Hopefully we can soon get to the bottom of this. Draft-handling has seen quite some work and if you haven't tried 1.28.1 (available from our website, and soon gplay/fdroid etc.) then please give it a try if you can, and let us know if you encounter the draft issue again. Many thanks for helping to fix this!

On Wed, Feb 02, 2022 at 22:07 -0800, c+aue wrote:

while trying to replicate the issue, i got it in a few minutes!

Screenshot_20220203-060420

my first draft was to stallman. by the time of the 3rd draft, stallman's was lost. then i did it again (with different wording) for the screenshot.

also saved the logs. let me know if i should include them.

-- Reply to this email directly or view it on GitHub: https://github.com/deltachat/deltachat-android/issues/2184#issuecomment-1028632961 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

cauerego commented 2 years ago

i think i can post it here. plus your email got censored @hpk42

deltachat-log-20220203-060411.txt

will update and try again next.

cauerego commented 2 years ago

i did encounter it again before i could install 1.28.1

but i didn't bother to log.

plus it didn't happen as fast. i had the drafts from days before, and they were gone. when trying to reproduce again in a few minutes for the second time, it didn't happen.

now i have both versions installed with more random drafts such as this.

Screenshot_20220207-130243

let me know if you still want more logs once i lose those drafts.

gerryfrancis commented 2 years ago

i did encounter it again before i could install 1.28.1

@cauerego So are you using 1.28.1 now?

let me know if you still want more logs once i lose those drafts.

@cauerego Yes, but test with 1.28.1, please, because it might be possible that it does not lose the drafts anymore. Thank you in advance!

Hocuri commented 2 years ago

I think I reproduced this (with 1.28.1): Set a draft, wait a few days, draft is gone. Will be kind of hard to debug since it just disappears at some random point in time, but should be doable. Logs don't help in this case unfortunately since they usually don't go back far enough.

cauerego commented 2 years ago

yes. still same here, as @Hocuri pointed.

using 1.28.1 along side, because both offered APK didn't update my fdroid one. so i duplicated my database.

my first log may contain some data, though, because it was all done within a few minutes.

gerryfrancis commented 2 years ago

I was able to reproduce the issue by typing some text in a 1:1 chat, delete older messages in it, go back, and hard terminate the app in Android preferences. After I launched the app again, the draft was still there, so I hard terminated the app one more time and launched it again afterwards, result: The draft has been gone. The log file contains a "hint" that housekeeping could have something to do with it, at least it happened at the moment when the app was launched.

Hocuri commented 2 years ago

Yip, it's housekeeping, thanks a lot for the hint @gerryfrancis! And thanks @cauerego for staying insistent!

I'll open a PR to fix it.

gerryfrancis commented 2 years ago

@Hocuri You are welcome, and thank you for fixing! :)

cauerego commented 2 years ago

more like a "fix attempt" imho... 😒

🤣😘