feat: Show error when deleting messages on unsupported channels#13685
feat: Show error when deleting messages on unsupported channels#13685joao-baza wants to merge 4 commits intochatwoot:developfrom
Conversation
Channels that don't support real message deletion via their external APIs (e.g., WhatsApp, Telegram, Facebook) now show an explicit error message instead of silently soft-deleting. Only Chatwoot-native channels (Web Widget and API) allow message deletion. Fixes chatwoot#13684
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a916b041b0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const canDeleteOnChannel = computed(() => { | ||
| const channelType = inbox.value?.channel_type; | ||
| return CHANNELS_WITH_DELETE_SUPPORT.includes(channelType); | ||
| }); |
There was a problem hiding this comment.
Allow private notes to bypass channel delete restriction
This gate is computed only from inbox.channel_type, so in non-WebWidget/API inboxes it blocks deletion for every message type, including internal private notes. Private notes (private: true) are Chatwoot-only content and do not depend on external channel delete APIs, so agents can no longer delete their own notes in WhatsApp/Telegram/Facebook conversations even though backend messages#destroy still supports it.
Useful? React with 👍 / 👎.
Description
Currently, the "Delete message" button in Chatwoot performs a soft-delete — it only removes the message from the Chatwoot interface but does not delete it on the external platform (e.g., WhatsApp, Telegram, Facebook). This causes confusion for agents who lose visibility of the conversation, while the customer retains the full chat history on their end.
This change shows an explicit error message ("This inbox does not support message deletion") when an agent tries to delete a message on a channel that doesn't support real deletion via its external API. Only Chatwoot-native channels (Web Widget and API) allow message deletion, since the soft-delete effectively removes the message for the end user.
Gostaria de especificar isso em outro momento, mas só para constar: é necessário adicionar a opção de exclusão real do Telegram, que suporta a exclusão de mensagens lado a lado. Talvez eu implemente isso após este PR ser aprovado.
Fixes #13684
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: