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

[AND-145] Fix pinned message list initial loading #5483

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

VelikovPetar
Copy link
Contributor

🎯 Goal

  • Fixes the initial loading of the pinned messages in the PinnedMessageListController.

🛠 Implementation details

  • Previously we didn't update the state.nextDate value to the current timestamp when calling the load() method - this resulted in reusing the nextDate from the INITIAL_STATE. This was wrong, as the INITIAL_STATE value is created when the PinnedMessageListController is created, and because it is part of the companion object, the same value is also used for any subsequently created instances of the controller.
    This meant that calling load on PinnedMessageListControllers which were created after the initially created controller, will use the 'old' timestamp to fetch the pinned messages, so any message pinned after the old timestamp, will not be retrieved.

  • Now we ensure that the state is properly updated with the current timestamp, when calling PinnedMessageListController.load

🎨 UI Changes

Before After
before.mp4
after.mp4

🧪 Testing

Steps to reproduce:

  1. Open a channel
  2. Open PinnedMessageList for the given channel
  3. Go back to channel
  4. Pin a new message
  5. Open PinnedMessages list
  6. The newly pinned message should be shown at the top of the list

@VelikovPetar VelikovPetar marked this pull request as ready for review November 22, 2024 15:51
@VelikovPetar VelikovPetar requested a review from a team as a code owner November 22, 2024 15:51
@JcMinarro JcMinarro enabled auto-merge (squash) November 26, 2024 09:44
@JcMinarro JcMinarro merged commit 750f97e into develop Nov 26, 2024
9 checks passed
@JcMinarro JcMinarro deleted the bug/fix_pinned_message_list_initial_loading branch November 26, 2024 09:51
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.

2 participants