[AND-145] Fix pinned message list initial loading #5483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
PinnedMessageListController
.🛠 Implementation details
Previously we didn't update the
state.nextDate
value to the current timestamp when calling theload()
method - this resulted in reusing thenextDate
from theINITIAL_STATE
. This was wrong, as theINITIAL_STATE
value is created when thePinnedMessageListController
is created, and because it is part of thecompanion object
, the same value is also used for any subsequently created instances of the controller.This meant that calling
load
onPinnedMessageListController
s 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.mp4
after.mp4
🧪 Testing
Steps to reproduce: