Skip to content

bug: Setting message_limit less than 25 in ChannelList props disables infinite scroll functionality #2360

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

Closed
Milad-Mohamadi opened this issue Apr 9, 2024 · 2 comments
Labels
bug Something isn't working status: unconfirmed

Comments

@Milad-Mohamadi
Copy link

Milad-Mohamadi commented Apr 9, 2024

Describe the bug

When configuring the ChannelList component with a message_limit value of less than 25, the "load more messages" functionality appears to be non-functional. This issue occurs even though the expected behavior is for the infinite scroll to work with any specified message_limit.

To Reproduce

  1. Environment Setup: Ensure you are using the latest version of stream-chat-react. This can be confirmed by checking the package version in your package.json file or by running npm list stream-chat-react or yarn list stream-chat-react in your project directory.

  2. Component Configuration: Implement the ChannelList component within your React application with initial properties set for watchers, filters, options, and custom components like so:
    <ChannelList watchers={{ limit: 10 }} filters={{ type: 'messaging', members: { $in: ['user-id'] }}} options={{ limit: 10, message_limit: 25 }} channelRenderFilterFn={channels => channels.filter(channel => channel.type === 'messaging')} Preview={CustomChannelPreview} Paginator={InfiniteScroll} LoadingIndicator={UnMemoizedLoadingChannels} />
    Replace 'user-id' with a valid user ID from your application.

  3. Adjust message_limit: Change the message_limit value within the options prop to a value less than 25, for example:
    options={{ limit: 10, message_limit: 20 }}

  4. Start the Application: Run your React application and navigate to the page or component where the ChannelList is rendered.

  5. Observe the Initial Load: Verify that the initial set of messages loads according to the specified message_limit.

  6. Attempt to Scroll: Try scrolling through the message list to trigger additional messages to load.

  7. Identify the Issue: Notice that despite reaching the end of the currently loaded messages, no additional messages are loaded regardless of the total number of messages available in the channel.

Expected behavior
The infinite scroll feature should work regardless of the message_limit value, allowing users to load more messages as they scroll.

Actual behavior
When the message_limit is set to a value less than 25, the infinite scroll functionality seems to be disabled, preventing more messages from being loaded.

Package version

  • stream-chat: ^8.11.0
  • stream-chat-react: ^10.10.1

Desktop:

  • OS: macOS 14.4.1 (23E224)
  • Browser: Chrome
  • Version: 123.0.6312.107
@Milad-Mohamadi Milad-Mohamadi added bug Something isn't working status: unconfirmed labels Apr 9, 2024
@myandrienko
Copy link
Contributor

Hi @Milad-Mohamadi, thanks for the report!

I can see that you are using v10 of our React SDK. The latest version is v11.14.0. We fixed the issue you're describing in the v11 branch not that long ago, so please upgrade and see if the issue is fixed for you.

Upgrade from v10 to v11 should be painless, however if you run into any difficulties, please refer to our upgrade guide.

I'm going to close this issue for now.

@myandrienko myandrienko closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
@Milad-Mohamadi
Copy link
Author

Milad-Mohamadi commented Apr 9, 2024

Thank you @myandrienko for the quick response! I'll upgrade to v11.14.0 and see if that solves the issue. Appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants