When a record was deleted, the related messages were remaining in discuss front-end causing an error when the user was clicking on them. This solves the problem by removing messages in the front-end as soon as they are deleted. Task-2960281 Part-of: odoo/odoo#99371