-
Notifications
You must be signed in to change notification settings - Fork 739
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
Timeline : fix 4959 #4966
Timeline : fix 4959 #4966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a small remark on a comment.
Thanks for the fast investigation!
(position until position + count).forEach { | ||
// Invalidate cache | ||
modelCache[it] = null | ||
} | ||
// Also invalidate the first previous displayable event if | ||
// it's sent by the same user so we are sure we have up to date information. | ||
val invalidatedSenderId: String? = currentSnapshot.getOrNull(position)?.senderInfo?.userId | ||
val prevDisplayableEventIndex = currentSnapshot.subList(0, position).indexOfLast { | ||
// In some cases onChanged will be called before onRemoved and onInserted so position will be smaller than currentSnapshot.size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// In some cases onChanged will be called before onRemoved and onInserted so position will be smaller than currentSnapshot.size. | |
// In some cases onChanged will be called before onRemoved and onInserted so position will be bigger than currentSnapshot.size. |
I think, no?
Matrix SDKIntegration Tests Results:
|
timelineEventVisibilityHelper.shouldShowEvent(it, partialState.highlightedEventId) | ||
} | ||
if (prevDisplayableEventIndex != -1 && currentSnapshot[prevDisplayableEventIndex].senderInfo.userId == invalidatedSenderId) { | ||
if (prevDisplayableEventIndex != -1 && currentSnapshot.getOrNull(prevDisplayableEventIndex)?.senderInfo?.userId == invalidatedSenderId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this change is necessary, since prevDisplayableEventIndex
will always be in the range [0, currentSnapshot.size[
.
Anyway, better safe than sorry I guess.
Included in hotfix #4971 |
Fix #4959 and add more logs.