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.
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
Fixed LHN Ordering #35907
Fixed LHN Ordering #35907
Changes from 9 commits
9b040c5
6333dcd
87826ab
06f5775
f556253
f8ab7cc
90343b9
6b19fd2
c61adb1
cf3147f
6649bb9
40e7a05
89a56b2
102bbda
1eca3e1
1314854
4e35908
e15075f
651e372
70ef3fc
91cea78
e2f769a
8495e60
29216c2
888195b
f14090e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 is not added to the dependencies of
useMemo
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.
reportErrors
seems to be an object, if we add it as dependency we should memoize it also on the parent componentparent:
and not sure about
reportIDsWithErrors
cc: @youssef-lr
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.
Just a though, having 2 reduces, one nested the other, won't make this function O(n*m).
can we create first the all reports.
and then later in the reduce you act as normally?? not sure if the code will work just guessing and code it here on the fly :)
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 have tried to do some optimization on this. Can you see this again?
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 think we should pass the violations to
getAllReportErrors
and add them to the dependencies of the memo. If we don't, this function will not be re-triggered if a violation changes in Onyx.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 should re-render as transactionViolations changes, which is a dependency of memo.
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.
But it is not a dependency of
reportIDsWithErrors
here, which means we won't re-rungetAllReportErrors
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.
@youssef-lr I think this is not needed. We are already subscribing to the violation collection, and it should re-render whenever any of the violations are updated.
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.
While yes the page will re-render, the
reportIDsWithErrors
will remain unchanged, as it only listens to changes in report actions and chat reports.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.
@shubham1206agra bump, can we pass the transactions to
getAllReportErrors
?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.
Apologies for the confusion, @fedirjh I disagree. Prior to the PR we weren’t pinning RBR reports, now that we’re memoized them, they are not subscribing to changes in the transaction.
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.
@shubham1206agra @fedirjh what's the latest here?
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.
We are awaiting @shubham1206agra to implement the changes.
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.
@fedirjh Can you retest this now?