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

🔥 [🐛] initialScrollToFirstUnreadMessage does not work #2591

Open
3 of 7 tasks
ricardojmf opened this issue Jul 9, 2024 · 7 comments
Open
3 of 7 tasks

🔥 [🐛] initialScrollToFirstUnreadMessage does not work #2591

ricardojmf opened this issue Jul 9, 2024 · 7 comments

Comments

@ricardojmf
Copy link

Issue

I'm trying to check the default InlineUnreadIndicator but with no success, it does not appear (even if I declare that I'm using it). I research your code base and saw that for it to appear the scrollToBottomButtonVisible should be true which mean that we have to open the chat with lots of unread messages pointed to the first one so that the scroll to button appears on the screen.

Unfortuanatelly this also did not work, I've added the prop initialScrollToFirstUnreadMessage to my <MessageList />component but it does not scroll to the first unread message (I've tested with 30 and 40 unread mesages)

Steps to reproduce

Steps to reproduce the behavior:

Having this config:

<MessageList
  initialScrollToFirstUnreadMessage
  InlineUnreadIndicator={InlineUnreadIndicator}
/>
  1. open up a chat with 40 unread messages
  2. wait for it to point to the first unread message
  3. it does not scroll
  4. it stays at the bottom (most recent message)

Expected behavior

  1. open up a chat with 40 unread messages
  2. wait for it to point to the first unread message
  3. it scrolls
  4. the InlineUnreadIndicator should appear

Project Related Information

Customization

Click To Expand

<MessageList
  initialScrollToFirstUnreadMessage
  InlineUnreadIndicator={InlineUnreadIndicator}
/>

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Click To Expand

package.json:

# N/A

react-native info output:

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1 Pro
  Memory: 255.31 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.2
    path: ~/.nvm/versions/node/v20.12.2/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.2/bin/npm
  Watchman:
    version: 2024.05.06.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/ricardo.figueiredo/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • 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:
    • 5.33.1
  • Device/Emulator info:
    • I am using a physical device
    • Device/Emulator: iPhone 13

Additional context

Screenshots

Click To Expand


@sergeyzhukov
Copy link

same issue

@isekovanic
Copy link
Contributor

Hi @ricardojmf,

Can you please pass this property to the Channel component rather than MessageList ? Despite it being available in both Channel and MessageList, it does certain actions within the Channel whenever this happens.

The reason why the scrolling doesn't happen for you whenever you have 30-40 messages is because the pagination window is lower and the channel is not properly loaded around the message you want to scroll to.

Handling it through the Channel component should properly handle these cases.

@WeAreArne
Copy link

@isekovanic, I tried this in our application (using version 5.23.2) and the scroll does not occur. Even with only a few messages (around 10) and more (around 25), it stays at the most recent message in the chat.

@isekovanic
Copy link
Contributor

Hi @WeAreArne ,

That's quite odd. Can you check if this is also happening on one of the newer versions of the SDK ? The reason being, there've been quite a lot of updates since version 5.23.2 and a lot of fixes to various things as well. It is possible that this got resolved in one of the newer versions.

@WeAreArne
Copy link

Hi @isekovanic, I tried updating to the most recent version, but this still doesn't seem to fix the issue.

@isekovanic
Copy link
Contributor

Hi @WeAreArne ,

Could you please have a look at version v5.42.0 ? It should fix your issues (or if it does not we can revisit this again).

Here's the changelod: https://github.com/GetStream/stream-chat-react-native/releases/tag/v5.42.0

@isekovanic
Copy link
Contributor

Hi again @WeAreArne ,

It seems that a regression was introduced in version 5.42.0 with an unrelated change - if you do bump please do it to version 5.42.1. Sorry for the inconvenience.

Changelog here: 75c3907

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

4 participants