Skip to content

[🐛] Bug Deleted Last Message Still Appears in Chat List Preview #3427

@osama-nextgeni

Description

@osama-nextgeni

Deleted Last Message Still Appears in Chat List Preview


Issue

When the sender deletes the last message in a conversation, the message is correctly removed from the conversation view, but it still appears in the ChannelList (chat list) preview.


Steps to reproduce

  1. Go to any existing 1:1 chat.
  2. Send a new message.
  3. Delete that message (ensure it is the most recent/last message).
  4. Navigate back to the Chat List (ChannelList).
  5. Observe that the deleted message still appears in the preview.

Expected behavior

When the last message is deleted:

  • The ChannelList preview should update immediately.

  • It should either:

    • Show the previous message (if one exists), or
    • Show an empty state (e.g., “No messages yet”).
  • The deleted message should not appear anywhere in the UI.


Project Related Information

Customization

Click To Expand

We are using customized components for:

  • Chat
  • ChannelList
  • Channel
  • MessageList

The issue occurs specifically in the ChannelList preview rendering logic.

# N/A

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled.

Environment

Click To Expand

package.json:

# N/A

react-native info output:

OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:

    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:

    • Please specify version
  • Device/Emulator info:

    • I am using a physical device
    • OS version: Specify
    • Device/Emulator: Specify


Additional context

The conversation screen updates correctly after deletion, but the ChannelList preview does not.

This may be related to:

  • Deleted messages still being present in channel.state.latestMessages
  • message.deleted_at not being filtered when rendering preview text
  • ChannelList not reacting properly to message.deleted events
  • Last visible message not being recalculated after deletion

Screenshots

Click To Expand

Image Image


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions