-
Notifications
You must be signed in to change notification settings - Fork 3.2k
perf: move report brick road statuses to a derived value #60827
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: move report brick road statuses to a derived value #60827
Conversation
…tus-derived-value
src/libs/ReportUtils.ts
Outdated
function generateReportAttributes({ | ||
report, | ||
reportActions, | ||
transactionViolations, | ||
}: { | ||
report: OnyxEntry<Report>; | ||
reportActions?: ReportActions; | ||
transactionViolations: OnyxCollection<TransactionViolation[]>; | ||
}) { | ||
const isReportSettled = isSettled(report); | ||
const isCurrentUserReportOwner = isReportOwner(report); | ||
const doesReportHasViolations = hasReportViolations(report?.reportID); | ||
const hasViolationsToDisplayInLHN = shouldDisplayViolationsRBRInLHN(report, transactionViolations); | ||
const hasAnyViolations = hasViolationsToDisplayInLHN || (!isReportSettled && isCurrentUserReportOwner && doesReportHasViolations); | ||
const reportErrors = getAllReportErrors(report, reportActions); | ||
const hasErrors = Object.entries(reportErrors ?? {}).length > 0; | ||
const oneTransactionThreadReportID = getOneTransactionThreadReportID(report?.reportID, reportActions); | ||
const parentReportAction = report?.parentReportActionID ? reportActions?.[report.parentReportActionID] : undefined; | ||
const requiresAttention = requiresAttentionFromCurrentUser(report, parentReportAction); | ||
|
||
return { | ||
doesReportHasViolations, | ||
hasViolationsToDisplayInLHN, | ||
hasAnyViolations, | ||
reportErrors, | ||
hasErrors, | ||
oneTransactionThreadReportID, | ||
parentReportAction, | ||
requiresAttention, | ||
}; | ||
} |
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 created this function to:
- Keep
reportAttributes.ts
as clean as possible - Those values can be later exposed by a derived value and it'll be possible to use them instead of calling those functions multiple times
…tus-derived-value
…tus-derived-value
…tus-derived-value
ca6de99
to
de7c06c
Compare
@hoangzinh @mjasikowski CI should be good now, unit tests are passing now |
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
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊 (1/14)Significant Changes To Duration
Show details
|
Performance Comparison Report 📊 (10/14)Meaningless Changes To Duration (9/13)Show entries
Show details
|
Performance Comparison Report 📊 (11/14)Meaningless Changes To Duration (10/13)Show entries
Show details
|
Performance Comparison Report 📊 (12/14)Meaningless Changes To Duration (11/13)Show entries
Show details
|
Performance Comparison Report 📊 (13/14)Meaningless Changes To Duration (12/13)Show entries
Show details
|
Performance Comparison Report 📊 (14/14)Meaningless Changes To Duration (13/13)Show entries
Show details
|
Performance Comparison Report 📊 (2/14)Meaningless Changes To Duration (1/13)Show entries
Show details
|
Performance Comparison Report 📊 (3/14)Meaningless Changes To Duration (2/13)Show entries
Show details
|
Performance Comparison Report 📊 (4/14)Meaningless Changes To Duration (3/13)Show entries
Show details
|
Performance Comparison Report 📊 (5/14)Meaningless Changes To Duration (4/13)Show entries
Show details
|
Performance Comparison Report 📊 (6/14)Meaningless Changes To Duration (5/13)Show entries
Show details
|
Performance Comparison Report 📊 (7/14)Meaningless Changes To Duration (6/13)Show entries
Show details
|
Performance Comparison Report 📊 (8/14)Meaningless Changes To Duration (7/13)Show entries
Show details
|
Performance Comparison Report 📊 (9/14)Meaningless Changes To Duration (8/13)Show entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.1.42-0 🚀
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.1.43-5 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.1.44-8 🚀
|
Explanation of Change
Fixed Issues
$ #59350
PROPOSAL:
Tests
Test case 1:
Test case 2:
OpenReport
Offline tests
n/a
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov