-
Notifications
You must be signed in to change notification settings - Fork 449
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
Optimize conversations update on Frontend #9832
Conversation
5ddf7d7
to
eda959c
Compare
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
eda959c
to
d8c10b6
Compare
/backport to stable27 |
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.
🤞🏼
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.
Looks good from the code perspective (but still lagging for me because of internal signalling)
addConversationIfChanged(context, { conversation, modifiedSince }) { | ||
if (conversation.lastActivity >= modifiedSince) { | ||
context.commit('addConversation', 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.
} | |
} else { | |
// Smart update | |
} |
Don't we want to apply smartUpdate here to cover rest cases (full re-fetch at least)?
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.
If we use the smartUpdate approach in else, then we do not need if
branch, as smartUpdate
covers all possible updates anyway
To test on internal you can add: this.roomListModifiedBefore = ~~(Date.now() / 1000) after this spreed/src/components/LeftSidebar/LeftSidebar.vue Lines 493 to 499 in d1adff8
|
☑️ Resolves
LeftSidebar
on re-fetching conversations every 30 seconds when:🖼️ Screenshots
No visual changes
🚧 Tasks
addConversationIfChange
to add new conversation only if it was moidified according tolastActivity
andmodifiedSince
postAddConversation
for common post-action of adding a conversationaddConversationIfChange
infetchConversations
action🏁 Checklist
docs/
has been updated or is not requiredAlternative and additional solutions
lastActivity
and oldlastActivity
, notmodifiedSince
LeftSidebar
performance in general in any case, including memory usage, interactive reaction and etc.