Opened 4 years ago
Closed 3 years ago
#1485798 closed Bugs (fixed)
Entries in DB table "identities" are not deleted nor re-used
| Reported by: | climaxy | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.4-beta |
| Component: | Database | Version: | 0.2.1 |
| Severity: | minor | Keywords: | identities, cleanup, database |
| Cc: |
Description
If a user creates an identity via the UI, an entry is created in the table "identities" within the DB.
point 1)
If the user is deleting the identity again via the UI, then in the table "identities" just the corresponding value from column "del" is set from 0 to 1 instead of deleting directly the whole entry out of the table
point 2)
To keep the entry in the DB as mentioned in point 1) would just make sense, in case the user would re-create an once deleted identity and the value "del" would be set back from 1 to 0.
=> But this is not the case: If I re-create exactly the same identity which I've deleted before, then a complete new entry is created within the DB!
=> So the current implementation serves no purpose and has just the effect, that the table is filling up with entries where a big amount could be already "dead entries" (= all entries with value "del" = 1), which will never be cleaned up.
Change History (4)
comment:1 Changed 4 years ago by alec
- Milestone changed from later to 0.2.2
comment:2 Changed 4 years ago by thomasb
- Milestone changed from 0.2.2 to later
- Severity changed from normal to minor
This is not really a bug but designed behavior. Records are just flagged as deleted in order to enable an administrator to undelete database records in case a user deleted them by accident. If you ever had to do some customer support you might know this kind phone calls...
However you can run a cronjob which removes all flagged entries from the database once a week.
comment:3 Changed 4 years ago by climaxy
It's clear to me that it's not really a bug but the implementation is also not 100% conclusive as mentioned under point 2) as even for identical input always a new entry is created.
(it's the same for sure for the "contacts" table - same implementation scenario)
May I propose or request following "solution":
The current used delete functions are "function delete" within rcube_contacts.php and "function delete_identity" within rcube_user.php which are both using the UPDATE query (= mark for deletion)
- Simply an additional function (e.g. delete_really) in both php files could be added which is using the DELETE query instead of the UPDATE query.
- Two parameters within the main.inc.php can then be introduced to decide globally if the entries for addressbook and identities shall be just marked for deletion or be really deleted by setting the parameters either to TRUE or FALSE ...and then the corresponding function is called.
Could you take this into consideration, please?
thx&br
comment:4 Changed 3 years ago by thomasb
- Milestone changed from later to 0.4-beta
- Resolution set to fixed
- Status changed from new to closed
The del column is actually meant to implement an undo function. However there's a cleanup script in trunk/roundcubemail/bin/cleandb.php which finally deletes old records marked as deleted. It is meant to be run in a daily cron job.

In my opinion identities could be deleted from table immediately.