Closed marc-farre closed 1 year ago
@luke- @marc-farre Fixed in PR https://github.com/humhub/mail/pull/352.
I think it is related to this https://github.com/humhub/mail/pull/344.
The error can be fixed by run Integrity Check tool.
Also I am thinking why the table message_entry
has no foreign key in order to delete when user is deleted, probably we should create it.
@yurabakhtin The mail module should use the User delete Event and delete corresponding Message entries. In addition, an FK would also be good. But the deletion should be done via events. (e.g. delete related files, a conversation must be deleted if the last message entry was deleted).
For corrupt dbs the current PR is ok
@luke-
The mail module should use the User delete Event and delete corresponding Message entries. But the deletion should be done via events.
Yes, we have the deletion of a message entry via events here - https://github.com/humhub/mail/blob/master/Events.php#L106-L108
In addition, an FK would also be good.
Ok, I will add FK, because not sure why db is corrupted sometimes.
@yurabakhtin Were there any issue in the past. Or why do we need the "[DELETED]" condition?
@luke-
Were there any issue in the past.
I have found only single issue where the [DELETED]
was added for records with not existing user:
Or why do we need the "[DELETED]" condition?
I have added the [DELETED]
there in order to fix error when DB is broken until it is not fixed by Integrity Check tool.
In addition, an FK would also be good.
Done in commit https://github.com/humhub/mail/pull/352/commits/5391a1205291a5aa1332d4f4fefe295e4f008de0.
@yurabakhtin thanks!
With the new version 3.1.0 I have the following error in the log each time I open a conversation (no visible bug, the module works well):