I created a message translation chatbot using the Reaction icon flag and responded with an ephemeral message. It worked well on Mattermost Version 7.8.2. However, after upgrading to Mattermost Version 9.11.5, the screen turned white, and I had to reload the Mattermost desktop.
After investigation, I found that the issue lies with sending the API post ephemeral. The API template is as follows:
import requests
url = "https://mattermostlink.linkl/mattermost/api/v4/posts/ephemeral"
payload = {
"user_id": "ud4ng3414pbufbr773o4138azy",
"post": {
"message": "string",
"root_id": "hrr6wmsk3iridpzwuamixdo33r"
}
}
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer 6a3gea7qabfm9rsg9aqrra1w4r"
}
response = requests.post(url, json=payload, headers=headers, verify=False)
print(response.json())
This is what I received when sending the request:
{'id': 'dmsfgjd6ejd95fomjafibtq38e', 'create_at': 1748337818336, 'update_at': 0, 'edit_at': 0, 'delete_at': 0, 'is_pinned': False, 'user_id': 'bmzzxasjwpdxf83iwhxo6bqhyc', 'channel_id': '', 'root_id': 'hrr6wmsk3iridpzwuamixdo33r', 'original_id': '', 'message': 'striaa ng', 'type': 'system_ephemeral', 'props': {}, 'hashtags': '', 'pending_post_id': '', 'reply_count': 0, 'last_reply_at': 0, 'participants': None, 'metadata': {}}`
How can I fix this issue? The problem relates to root_id
. For messages that need to be replied to, the root_id
must be present. However, in the new version, this causes the screen to turn white. Please help me.
For non-ephemeral messages, the root_id normally.