stream-chat-react-native icon indicating copy to clipboard operation
stream-chat-react-native copied to clipboard

[🐛] Enable to load messages when user deleted more 100 message (pagination)

Open neopit opened this issue 4 months ago • 0 comments

Issue

A user reported an issue where no messages were visible in their chat, despite being certain that messages were present.

After investigating, we found that the user had deleted more than 100 messages. The chat was configured with deletedMessagesVisibilityType={'never'}, which means deleted messages are hidden. As a result, the chat appeared empty because all visible messages had been deleted, triggering the empty state component.

Due to the empty state, the user was unable to scroll through the list, preventing the system from fetching the next page of messages.

We believe this is a bug. In cases where deletedMessagesVisibilityType={'never'} is active and more than 100 messages have been deleted on the current page, the component should handle this scenario by automatically fetching subsequent pages until an active message is found.

Steps to reproduce

Steps to reproduce the behavior:

  1. Configure the chat with deletedMessagesVisibilityType={'never'}.
  2. In a chat, delete more than 100 messages.
  3. Reopen the chat where all deleted messages are hidden.
  4. Observe the chat displaying the empty state component due to the absence of visible messages.
  5. Attempt to scroll the chat to trigger the loading of the next page of messages. (but it is not possible to scroll :-) )

Expected behavior

When more than 100 messages are deleted and deletedMessagesVisibilityType={'never'} is configured on <MessageList />, the chat should automatically load the next page of messages, skipping over deleted ones, until an active (non-deleted) message is displayed.

Technically, if the component displays 100 messages per page, and if deletedMessagesVisibilityType={'never'}, then the component has to pull the next active 100 messages even if there is a deleted message in the middle.

Project Related Information

Customization

N/A

Offline support

N/A

package.json:

# N/A

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • [X ] iOS
    • [X ] Android
    • [ ] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ X] Both
  • stream-chat-react-native version you're using that has this issue:
    • 5.39.4
  • Device/Emulator info:
    • [ ] I am using a physical device
    • OS version: e.g. Android 10
    • Device/Emulator: e.g. iPhone 11

Additional context

N/A

Screenshots

N/A


neopit avatar Oct 21 '24 23:10 neopit