-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove ReportConnection and ReportActionsConnection files #53385
Remove ReportConnection and ReportActionsConnection files #53385
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
// Dynamic Import to avoid circular dependency | ||
const UnreadIndicatorUpdaterHelper = () => import('./UnreadIndicatorUpdater'); |
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.
Do we still need this?
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.
Yes, without it the tests - both unit and perf are failing
src/libs/actions/Task.ts
Outdated
ReportConnection.updateReportData(parentReportID, { | ||
lastReadTime: currentTime, | ||
}); | ||
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`, {lastReadTime: currentTime}); |
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 change is different from the previous behaviour in ReportConnection.ts, where we update the local allReports
instead of doing Onyx operations. It would be good to understand why we were doing that before and if it's safe to use Onyx operations instead.
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 looks like it will be removed anyway: https://github.com/Expensify/App/pull/51174/files#r1866068419
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.
Nevertheless, I've asked the author why this approach was selected initially.
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.
huh yeah I agree this is weird, what is the conclussion?
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.
Overall the ReportConnection.updateReportData
function, as well as some other changes including reportLastReadTime memoized value were introduced in this PR to fix this issue: #50792.
I've tested the issue over my PR and it works as expected.
I've just tried to remove the updates raised in that PR as it was recommended, and there is no issue for me as well. So I think we can get rid of it, did it in: d01ac8d
ios_no_new_line1.mp4
…eport-connection # Conflicts: # src/libs/ReportUtils.ts
…eport-connection # Conflicts: # src/libs/actions/Report.ts
@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@thesahindia Any ETA on reviewing this one? |
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.
🚀
@@ -606,7 +604,7 @@ const ContextMenuActions: ContextMenuAction[] = [ | |||
successIcon: Expensicons.Checkmark, | |||
shouldShow: ({type, isProduction}) => type === CONST.CONTEXT_MENU_TYPES.REPORT && !isProduction, | |||
onPress: (closePopover, {reportID}) => { | |||
const report = ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; | |||
const report = ReportUtils.getReport(reportID); |
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.
Left ReportUtils.getReport
in this file, cause it's already used there, and changing it gives the error:
Only call Onyx.connect() from inside a /src/libs/** file. React components and non-library code should not use Onyx.connect() rulesdir/prefer-onyx-connect-in-libs]
@mountiny I've applied the feedback, please take another look 👀 |
Asked @thesahindia for retest |
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.
Tested with the new steps. Works fine.
…eport-connection # Conflicts: # src/libs/ModifiedExpenseMessage.ts
@mountiny All yours! |
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.
Thanks!
✋ 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 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
These have been flaky after the hybrid app switcharoo |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.76-0 🚀
|
@VickyStash Found KI when checking the PR - #54126, #54129 |
🚀 Deployed to production by https://github.com/grgia in version: 9.0.76-12 🚀
|
Explanation of Change
Remove ReportConnection and ReportActionsConnection files as they are not necessary anymore and have no effect on the app performance.
TTI before: 7916ms, 7662ms,7273ms
TTI after ReportConnection: 7942ms, 8223ms, 7302ms
Fixed Issues
$ #53141
PROPOSAL: N/A
Tests
Part 1:
3.1 Create a chat
3.2 Send several messages from Users A and B
3.3. Submit expense manual/scan/distance
3.4. React to the message/update it/delete
Part 2:
Offline tests
Same, as in the Tests section.
QA Steps
Same, as in the Tests section.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
android0.mp4
Android: mWeb Chrome
android_web0.mp4
iOS: Native
ios0.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web0.mp4
MacOS: Desktop
desktop0.mp4