Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks
neopit opened this issue Oct 21, 2024 · 1 comment
Open
3 tasks

Comments

@neopit
Copy link

neopit commented Oct 21, 2024

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


@khushal87
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants