GetStream / stream-chat-react-native

💬 React-Native Chat SDK ➜ Stream Chat. Includes a tutorial on building your own chat app experience using React-Native, React-Navigation and Stream
https://getstream.io/chat/sdk/react-native/
Other
970 stars 325 forks source link

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

Open neopit opened 5 days ago

neopit commented 5 days ago

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 , 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

Additional context

N/A

Screenshots

N/A


khushal87 commented 1 day ago

Hey @neopit, as discussed on our Slack channel, this issue has to be addressed by the Stream backend and is more of a product discussion, so we are awaiting a response from them, and then we can handle it in the SDK. Until then, you can choose to show deleted messages in the UI.