mattermost/mattermost

[Bug]: File and message sent to wrong recipient after switching chats during upload.

Open

#31 216 ouverte le 28 mai 2025

Voir sur GitHub
 (3 commentaires) (3 réactions) (1 assigné)TypeScript (32 880 stars) (7 823 forks)batch import
Help Wanted

Description

Before you file a bug report

Mattermost Server Version

10.6.0

Operating System

macOS

Steps to reproduce

  1. Open a chat with User 1.
  2. Attach a large file (to ensure some upload time).
  3. Type a message that should go along with the file, but do not send it.
  4. Without waiting for the file to finish uploading, switch to a chat with User 2.
  5. Wait for the file upload to complete.
  6. Observe that the file and typed message now appear in the chat with User 2.
  7. Delete the mistakenly inserted file and message in the chat with User 2.
  8. Try sending a new message in the chat with User 2.
  9. Observe that the message is actually sent to User 1 instead of User 2.

Expected behavior

  • The file and message should remain in the original chat (User 1), even if the user switches to a different chat before the upload completes.
  • After deleting the incorrect message in User 2's chat, any new message should be sent to User 2.

Observed behavior

  • Once the file upload completes, the file and the unsent message — initially prepared while in the chat with User 1 — are incorrectly posted in the currently open chat with User 2, instead of staying in the original chat.
  • Even after deletion, subsequent messages typed in User 2's chat may be sent to User 1.

Log Output

Additional Information

This issue can cause serious confusion or unintended data sharing with the wrong person.

It appears to be tied to how upload state and active chat context are handled asynchronously.

This behavior was also reproduced in the web version of Mattermost (Google Chrome, Firefox), which suggests that the issue may be on the server side rather than specific to the desktop client.

Guide contributeur