Skip to content

fix: channel list stale last message#3534

Merged
isekovanic merged 1 commit intoV8-releasefrom
fix/channel-list-reload-not-updating
Apr 6, 2026
Merged

fix: channel list stale last message#3534
isekovanic merged 1 commit intoV8-releasefrom
fix/channel-list-reload-not-updating

Conversation

@isekovanic
Copy link
Copy Markdown
Contributor

🎯 Goal

This PR fixes an issue where regaining connection (or just loading the app with offline mode enabled) would not properly update the last message for any channels that've changed in the interim.

The reason for this was a very old (seemingly) problem with how channel.lastMessage() is calculated, completely bypassing the actual last message and not reloading the state at all (even though the channels would actually swap places as they should and their internal state would be correct).

This will be ported to V9 as well soon after.

πŸ›  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

const [forceUpdate, setForceUpdate] = useState(0);
const [lastMessage, setLastMessageInner] = useState<LastMessageType>(
() => channel.state.messages[channel.state.messages.length - 1],
() => channel.state.latestMessages[channel.state.latestMessages.length - 1],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been wrong for years it seems, as we found with @MartinCupela . It's a pretty nasty edge case where if your first load of a channel is to a message in a different message set than the latest one (i.e through a deeplink let's say), the channel list would basically show the last message of that page only (and not the actual latest message in the channel).

@Stream-SDK-Bot
Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 348 KB 304 KB -44606 B πŸš€

@isekovanic isekovanic merged commit f6b08e4 into V8-release Apr 6, 2026
5 checks passed
@isekovanic isekovanic deleted the fix/channel-list-reload-not-updating branch April 6, 2026 13:50
isekovanic added a commit that referenced this pull request Apr 6, 2026
## 🎯 Goal

This PR is a port of [this
change](#3534)
to V9.

## πŸ›  Implementation details

<!-- Provide a description of the implementation -->

## 🎨 UI Changes

<!-- Add relevant screenshots -->

<details>
<summary>iOS</summary>


<table>
    <thead>
        <tr>
            <td>Before</td>
            <td>After</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <!--<img src="" /> -->
            </td>
            <td>
                <!--<img src="" /> -->
            </td>
        </tr>
    </tbody>
</table>
</details>


<details>
<summary>Android</summary>

<table>
    <thead>
        <tr>
            <td>Before</td>
            <td>After</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <!--<img src="" /> -->
            </td>
            <td>
                <!--<img src="" /> -->
            </td>
        </tr>
    </tbody>
</table>
</details>

## πŸ§ͺ Testing

<!-- Explain how this change can be tested (or why it can't be tested)
-->

## β˜‘οΈ Checklist

- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants