-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
perf: Dont update list view data if list view not active #20396
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #20396 +/- ##
===========================================
+ Coverage 63.82% 63.96% +0.14%
===========================================
Files 758 757 -1
Lines 68620 68635 +15
Branches 6188 6190 +2
===========================================
+ Hits 43796 43904 +108
+ Misses 21296 21230 -66
+ Partials 3528 3501 -27
Flags with carried forward coverage won't be shown. Click here to find out more. |
if (!cur_list || route[0] != "List" || cur_list.doctype != route[1]) { | ||
// wait till user is back on list view before refreshing | ||
return; | ||
} |
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.
This might break when/if user comes back but no new event is received, perhaps we can just trigger this function again when list view is rendered to process pending refreshes.
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.
it doesn't cause on every render it refreshes.
I think we should un-sub/re-sub from/to updates on route change instead 🤔 We don't need the updates via Socket when we're not on the view as a refresh call ( There's no APIs for unsubscribing at this point (it's just refreshing desk xD) |
You can do |
Steps to reproduce: 1. visit a list view that's quite active 2. move to some other page 3. list view data keeps getting refreshed in background Fix: Only refresh when user is back on list view
will fix unsubscribing later... merging this for now to reduce self inflicted DDOS 😔 |
Steps to reproduce: 1. visit a list view that's quite active 2. move to some other page 3. list view data keeps getting refreshed in background Fix: Only refresh when user is back on list view (cherry picked from commit 7fc6ae6)
Steps to reproduce: 1. visit a list view that's quite active 2. move to some other page 3. list view data keeps getting refreshed in background Fix: Only refresh when user is back on list view (cherry picked from commit 7fc6ae6)
# [14.29.0](v14.28.2...v14.29.0) (2023-03-21) ### Bug Fixes * allow 5 column layout in doctype form ([7eb3bb4](7eb3bb4)) * Allow card actions (adding/dragging) if access to reference doctype ([bc5b362](bc5b362)) * Check perms on Kanban Column actions ([efa74bb](efa74bb)) * Check Reference Doctype perms & control indicator change ([c2fe3b0](c2fe3b0)) * clear contacts cache (backport [#20397](#20397)) ([#20406](#20406)) ([1905241](1905241)) * **Database:** clear background jobs and realtime logs on rollback ([#20236](#20236)) ([#20417](#20417)) ([750059b](750059b)) * Dispatch `update_order` always. Handle perm-wise action in backend ([e5c5cdb](e5c5cdb)) * handle image extraction while editing comment ([00c5f32](00c5f32)) * Hide Menu if empty & render columns without state change ([a9b5f04](a9b5f04)) * hide My Workspace sidebar section if empty in edit mode ([b51dd18](b51dd18)) * Hide Sort Selector in Kanban ([13be928](13be928)) * Kanban Board Menu Items Accessibility via perms ([4ffc7a5](4ffc7a5)) * **meta:** get_permitted_fields with no field-columns (backport [#20401](#20401)) ([#20405](#20405)) ([644c6c8](644c6c8)) * **patch:** move desk prop patch to post model sync ([#20361](#20361)) ([#20362](#20362)) ([661820a](661820a)) * **print:** Language set in document should have higher precedence (backport [#20336](#20336)) ([#20338](#20338)) ([a27178d](a27178d)) * server method to return evaluated dict of perms for a document ([d1446b8](d1446b8)) * Set link title in PDF ([716db05](716db05)) * sidebar becomes unhidden while removing skeleton ([71ac099](71ac099)) * skip InReadOnlyMode in error snapshots ([#20358](#20358)) ([#20359](#20359)) ([eb14fe1](eb14fe1)) * treat Phone as Data on list view ([06395dd](06395dd)) * **workspace:** Setup Dynamic Link if value exists ([b393d5b](b393d5b)) ### Features * clear integration log request logs ([#20373](#20373)) ([#20374](#20374)) ([4c48f55](4c48f55)) * configurable rounding methods (v14 port) ([#20330](#20330)) ([0d60385](0d60385)), closes [#20299](#20299) * **minor:** log datetime in worker log ([#20414](#20414)) ([#20418](#20418)) ([bfda74d](bfda74d)) ### Performance Improvements * Dont update list view data if list view not active ([#20396](#20396)) ([#20420](#20420)) ([3a6e307](3a6e307)) * rebuild website search index in background (backport [#17974](#17974)) ([#20335](#20335)) ([c1b0210](c1b0210))
## [13.51.2](v13.51.1...v13.51.2) (2023-03-21) ### Bug Fixes * **Database:** clear background jobs and realtime logs on rollback ([#20236](#20236)) ([#20416](#20416)) ([f4f399e](f4f399e)) * **meta:** get_permitted_fields with no field-columns (backport [#20401](#20401)) ([#20404](#20404)) ([d2be9d7](d2be9d7)) * **print:** Language set in document should have higher precedence (backport [#20336](#20336)) ([#20337](#20337)) ([2a84075](2a84075)) ### Performance Improvements * Dont update list view data if list view not active ([#20396](#20396)) ([#20419](#20419)) ([85cd2d2](85cd2d2))
Steps to reproduce:
Fix: Only refresh when user is back on list view