Skip to content

Conversation

@isekovanic
Copy link
Contributor

🎯 Goal

This PR addresses an issue where the MessageList's underlying FlatList would get caught in a weird infinite scrolling (into nothing) state whenever we removed the last item inside of it.

This was particularly obvious on threads, with the following reproduction steps:

  • Set deletedMessagesVisibilityType={'never'} on the Channel component encapsulating a Thread
  • Create a thread from a message
  • Write a single message into the thread
  • Delete the message (no Deleted Message default as we set the visibility to never)
  • The FlatList would now spin endlessly

The actual issue is that the FlatList completely bugs out whenever we pass it an index it can clearly not find (since the message got deleted, the index no longer exists. Instead, we keep the minIndexForVisible set to 1 for anything other than an empty list.

Should also close this Github issue.

🛠 Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@Stream-SDK-Bot
Copy link
Contributor

SDK Size

title develop branch diff status
js_bundle_size 450 KB 450 KB 0 B 🟢

@isekovanic isekovanic merged commit 857d220 into develop Jun 25, 2025
5 checks passed
@isekovanic isekovanic deleted the fix/min-visible-index-breaking-threads branch June 25, 2025 12:23
@github-actions github-actions bot mentioned this pull request Jun 26, 2025
6 tasks
@stream-ci-bot
Copy link
Contributor

🎉 This PR is included in version 7.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛] iOS. deletedMessagesVisibilityType='never' breaks FlatList on message delete

5 participants