-
-
Notifications
You must be signed in to change notification settings - Fork 27
Limit retained history #244
Comments
See https://support.delta.chat/t/reduce-space-on-internal-storage-disk-full/132/24 |
In combination with "vacuum" perfect shot in a first glance :) ... and really important meanwhile. The local device should be in focus, really! |
Related to that, maybe it's worth to show some simple statistics:
And finally: what about different location (external sd card) for attachments or database? |
this would degrade security and/or make a secure system more complicated, so, at least for now, i would not vote for this. |
Ok understood. I suspected that this comment will arrive ;-) Then I think the issue "different location" (You mean only that?) should excluded here and I will open a separate new issue for that. This is the better approach :) |
yes, "different location" and sd-card is an different issue with its own problems :) |
Hi @r10s There are some prerequisites before:
|
yeah, it is important, but there are many important ones curently :) from the core, some prerequisites are already fulfilled, eg. starring messages is already implemented in the core. |
Just noticed that limiting the chat history won't help either, because even a device with very few chat messages has an ever growing database. I think this is because all the incoming email messages (aka "contact requests") are never automatically deleted, i.e. when they get removed from the server's INBOX folder, usually by other MUAs. (Having to delete classic emails in deltachat is kind of a dangerous and unnecessary task.) Reopen?: "Emails deleted/moved from INBOX on server, need also be removed from "contact requests"" #195 (It's basic IMAP server usage.) @csb0730 your optional configuration wishes deltachat/deltachat-android#321 and deltachat/deltachat-android#327 remain untouched |
currently, this is true. however, the deletion of old messages we're taking about here include the contact requests (which are also only messages). |
Hopefully you just haven't thought it through yet before answering, deleting the x+1st email from the INBOX sounds kind of wrong. I mean when there was work done on an outline like #120 + #195 it doesn't mean the checkmarks can't be further improved, or implemented in selective steps, like first only implementing auto-deletion as you seem to mean with this issue. |
well, this happens all the time to me :)
however, in this case i think it is fine. the issue is about deleting messages from the device, not from the server. |
Ha, ha, yes :-) I could only guess, because... you know, happens to me too all the time, and that's how we improve things :) I consider the incoming emails (old "contact requests") to be under the "authority" of classic MUAs, while the chat folder is under the "authority of deltachat. And the IMAP server is to be used as "authoritative" to sync between clients. But some clients may optionionally keep larger archives. By default, the INBOX gets sorted out by the user using or configuring the classic MUAs, but deltachat can allow the user to start a chat by replying and directly delete junk from the INBOX. Now, if deltachat would delete incoming email only locally, that would not allow providing the user with a consistent view between MUAs. It would be a change from the current deleting behaviour, and it would later have to be changed again (to also delete on server) to allow that multiple clients provide a synchronized view.
I don't think the general simplification to only-delete-locally would allow a complete solution to the problems. With others working on the frontends, I hope you'll be able to do the little refinements to the core that bring the email-chat compatibility concepts to perfection. |
imagine a multi-device setup with an android phone with few memory and a desktop mua. while the android phone may have 512 MB available for the database and lets deltachat delete messages from the device - why should these messages not stay on the desktop mua? also, not having the whole messages archive on a device i carry with me may be wise from a security point of view - but this does not mean the messages cannot stay on another device at home. |
Yes, that was exactly the reason for the "archived" property for messages in #120. It provides independence between clients and the server. For example, on a small phone the archive can be cut down (or even disabled) differently as the archive on the desktop. And at the same time, the space used on the server is also independent from all the clients' archive sizes. The idea is for the active chats to get synced, but the archives to be device specific. If a chat message gets deleted on the server, the clients locally deletes active chat messages, but keeps the message if it has the "archived" state (only local archive purging rules apply). If a chat message is deleted on a client and there is no "archived" message property implemented, the user would need to be able (and have to manually decide, with an annoying question) whether to only delete locally or also on the server (to not have to remove it again from all other clients). EDIT: With the "archived" flag available, deletions of messages can always be carried out on on the server as well (if still there). The desktop client may archive all messages right away, and the user effectively only working with archives then, to ensure a local copy is always kept on the desktop. (Hope I could explain that in an understandable manner.) |
EDIT: I'm not sure what you meant here. Didn't I always mean to delete on server, too? Do you mean me not wanting to auto-delete emails from the local "incoming emails"?
|
But the basic problem is of course always that deleting only locally does not prevent running out-of-space used on the server, and creates the annoyance to have to manually repeat every delete on every device. (Therefore I see the "show only the last 100 emails" as an exception, just to protect from large INBOXes.) |
If you mean this issue as fixing things for a suitable v1.0 -core, it may be seen as equivalent to implementing "Chat message selection", "Deletion management" without the bulk delete UI, and vacuum from "Storage Restrictions" in #120, while its "Archive management" could stay for the later multi-client support. |
true, but i would regard this as different issues. wrt VACUUM: this is no no-brainer: during execution of the statement the database may be take up double place. also this is a typically long-running command, so it might not make much sense to call it automatically. |
Agree, vacuum is important and space consuming (at least double size of db) and should be executed manually. I tried it manually with a backup db at desktop. Maybe it's necessary to lock database while execution. I think depending from the device it can take many minutes! Agree too, deleting from device is urgent because at current state I really suspect database is growing endless and no chance to shrink it at device. Sooner or later space runs out and then even a backup is impossible :-/ For me the local device is more important to attack because here I have to live with dc's possibilities, at server I have multiple possibilities to deal with :-) |
also for me this is much more urgent :) |
Could make sense for DC to limit the DB size to half of the free storage size, to trigger vacuum, and by this allow receiving new messages at all times. |
Different thing to solve, yes, the formality itself isn't too important for me, I rather think it is important to have the related things written down and public in an open issue, where it stays to document an area where solving only one part creates bugs/problem in other parts:
Seems we all agree on that. And we know the next problems that will occur, and can stay on top of things by keeping a properly edited issue for the related things open, until the area gets fixed completely. |
Last days I learned that main problem are attachments which are stored in database. I had mail conversation with @r10s regarding that issue. A secure finding is, that after deleting big attachments the vacuum function is absolutely required. No chance without using that to reduce storage space. Unclear for me is in the moment why additional storage is required beside database storage space. Some findings:
(all this device local !) |
@csb0730 normally, attachments are not stored in the database. instead they are stored as normal files beside the database. when doing a backup, however, to have a single, handy file, these normal files are added to the table this could be optimized by importing to a new database using ATTACH and INSERT INTO so that a final VACUUM is not needed and temporary less space is needed, however, before we optimize on this, imo things as #149 should be solved. |
This seems to me a reasonable approach for now :) But what worries me a little is the big difference between the size of backup file (1,05GB, which then should include all data) and the size of total memory reported by app manager for DC (1,77GB). |
have you tried a re-install of delta and import the backup? |
Hi @r10s, (What I described above were some examinations with the backup db file at PC and sqlite behaviour around But because memory of my phone was short I suspect that maybe the Is it possible to examine the original database at device? Maybe copying to PC by adb or copying it to download dir? |
Depending on outcome now: Maybe it's more reliable to use an extra db file for all attachments in backup because then the vacuum wouldn't be so memory critical at import (vacuum)! Extra db file can be deleted and that's it. |
Some test done with a fresh backup from dc v0.20.0 (db size is 1001.9 MB) at PC:
Result is:
"vacuum" cannot performed, even manually after db was closed and changes written to db!
Result now:
Conclusion: @r10s: can You confirm this? |
I think the following code should be used in
This should get the code working as expected (trial at real device outstanding !) |
I described many things regarding backup export import with last comments. The more I think about this the more I come to the conclusion that this is worth to open an extra issue for that. Nevertheless will do some tests described in the last comments next days. |
Continuation of memory problem see new issue #261 |
Comments until to 28 Aug 2018 are belonging to the real issue described ! |
I think, the best high-level solution overview, that came out of this issue and #120, is at: => Solving all the different server and device storage requirement use-cases with only 3 simple user-facing items, and a default to always allow operation. |
Now we have the new UI and most of work relating that is done. But because of this isssue is a really necessary UX feature for daily use: Is anyone working on that? |
to avoid taking up all device "disk"-memory, there should be an option to limit the retained history.
compared to using a fixed time, this would have the advantage that rarely used chats are not affected.
The text was updated successfully, but these errors were encountered: