EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

Bug: Thread UI remains open after parent message is deleted (State Leak)

Open deepak0x opened this issue 10 months ago • 2 comments

A frontend state management bug exists where the Thread View remains open and displays stale data even after its parent message has been deleted from the chat.

While the messageStore correctly removes the deleted message from the main message list, it fails to synchronize thread-specific state. As a result, thread-related state continues to reference a message that no longer exists.


Observed Behavior

  • The parent message is removed from the main chat message list.
  • The Thread Pane remains open.
  • The Thread View continues to display a stale copy of the deleted parent message.
  • The application enters an inconsistent UI state where a thread is shown for a non-existent message.

Screenshots

Rocket chat web Image

Embedded chat Image

Expected Behavior

When a parent message is deleted:

  • Any active thread associated with that message should automatically close.
  • Thread-related state should be cleared from the store.
  • The UI should return to the normal chat view without an open thread.

Steps to Reproduce

  1. Open the EmbeddedChat application.
  2. Send a new message or select an existing message.
  3. Open the Thread View for that message.
  4. Delete the parent message (from EmbeddedChat or another client).
  5. Observe the UI state.

Result:

  • The message disappears from the main chat list.
  • The Thread Pane remains open with stale data.

deepak0x avatar Jan 17 '26 16:01 deepak0x

@Spiral-Memory pls let me know about this

deepak0x avatar Jan 17 '26 17:01 deepak0x

Hi @Spiral-Memory — is this one free to pick up (not earmarked for GSoC)? Looks like the thread view holds its own copy of the parent message, so when messageStore removes it the ThreadView never resets. I'd fix it by deriving the open thread from the store (and closing the view when the parent id disappears) rather than patching the symptom. Happy to open a PR if that direction works.

prawnsgupta avatar Jul 15 '26 11:07 prawnsgupta