Skip to content

Conversation

andremion
Copy link
Contributor

@andremion andremion commented Oct 10, 2025

🎯 Goal

Unsent messages should be placed as the last ones in the message list

🛠 Implementation details

Ensure the message has a Message.createdLocallyAt timestamp.
If not, set it to the max of the channel's Channel.lastMessageAt + 1 millisecond and now.
This ensures that the message appears in the correct order in the channel.

🎨 UI Changes

Before After
Screen_recording_20251013_140608.webm
Screen_recording_20251013_140449.webm

🧪 Testing

  • Set the device clock to a time in the past.

  • Send a message in the online state.

  • Send a new message in the offline state.

  • Observe that the new message is placed as the last one.

  • Send an attachment message.

  • While the attachment is being uploaded, send a new message.

  • Observe that the attachment message is placed above the new message while the upload is not completed.

  • Observe that the attachment message is placed below the new message when the upload is completed.

Copy link
Contributor

github-actions bot commented Oct 10, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.22 MB 3.22 MB 0.00 MB 🟢
stream-chat-android-offline 3.45 MB 3.45 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.54 MB 10.54 MB 0.00 MB 🟢
stream-chat-android-compose 12.75 MB 12.75 MB 0.00 MB 🟢

@andremion andremion changed the title Unsent messages should be placed as the last ones in the list Unsent messages should be placed as the last ones in the message list Oct 10, 2025
@andremion andremion force-pushed the AND-839-fix-unsent-messages-is-not-the-last-in-the-list branch 3 times, most recently from 98568e7 to 280b1fa Compare October 13, 2025 13:01
@andremion andremion force-pushed the AND-839-fix-unsent-messages-is-not-the-last-in-the-list branch from 280b1fa to a8a80c0 Compare October 13, 2025 13:17
@andremion andremion marked this pull request as ready for review October 13, 2025 13:24
@andremion andremion requested a review from a team as a code owner October 13, 2025 13:24
@andremion andremion added the compose Jetpack Compose label Oct 13, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
65.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@VelikovPetar VelikovPetar merged commit 136f46f into develop Oct 14, 2025
12 of 13 checks passed
@VelikovPetar VelikovPetar deleted the AND-839-fix-unsent-messages-is-not-the-last-in-the-list branch October 14, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compose Jetpack Compose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants