[Comments] Batch resolve #7236
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#7236
Loading…
Reference in a new issue
No description provided.
Delete branch "batch-resolve"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes
Now comments, and replies when expanded, get batch-resolved, and avoid getting re-resolved on components like channelThumbnail or uriIndicator. There is no issue for it but all those resolve requests are unnecessary, also does this help with CPU stuff (#6473, #7177) @infinite-persistence ?
Initial comments below. Will look deeper tomorrow.
This feels heavy because:
connect
gets called every time there is a dispatched action or store change. e.g. Refreshing the comments to page 1 alone called this loop 5-6 times, which is why these heavy transformations are done in a memoized selector.I think the idea of batch-resolving at
CommentList
is good, but wondering if there is a leaner way to do it.Suggestion:
alreadyResolved
to several components, can we try to use the cache-awaredoResolveUris(uris, true)
for those affected components? Then, no extra code will be needed as the checking will be encapsulated indoResolveUris
. This also avoids adding more props, especially forComments
which is getting out of hand.Probably don't need to handle pinned comments too (let it resolve individually) -- the count is usually low, so we can save one transformation and just batch-resolve
topLevelComments
done! Looks much cleaner now
@ -27,2 +37,4 @@
return {
topLevelComments,
resolvedComments,
myChannels: selectMyChannelClaims(state),
resolveComments = topLevelComments.filter()
might be a clearer choice to convey the intention, but that's minor.a0a9828 to
620de2e