-
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
[Audit][Implementation] hasDraft replacement #37281
[Audit][Implementation] hasDraft replacement #37281
Conversation
c0ade66
to
272633a
Compare
272633a
to
d177314
Compare
d2c0022
to
024a50c
Compare
Due to coupling between This means, at least for now we need to skip the performance benefit of removing |
By comparing behaviour with Messenger app, the code here does not treat spaces-only messages as valid drafts, thus they are not saved. It can be changed anytime - just let me know what is the descision 👍 |
@@ -780,7 +784,12 @@ describe('Sidebar', () => { | |||
}) | |||
|
|||
// When a new report is added | |||
.then(() => Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${report4.reportID}`, report4)) | |||
.then(() => | |||
Promise.all([ |
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 in order to sync the merges in Onyx, I've used Promise.all
here. Let me know if that's the correct way 🙏
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.
@kacper-mikolajczak Why do we need this? Can you explain this a bit?
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 AFAIK, there is no multiSet
alternative (except for lower-level Onyx.update
) so in order to merge those two values 'at once' (they are done separately but eventual consistency is what we care about), they are wrapped with Promise.all
. I am not sure, if other methods would have exact same outcome.
tl;dr; It waits for all the values to be merged successfully so the test can operate on up-to-date values
@kacper-mikolajczak Can you merge main here? |
Hi @shubham1206agra, are changes introduced in this PR approved by you? |
No 😆 . Its just a coincidence. |
@shubham1206agra Could you please review the PR as soon as I resolve the conflicts? Thanks! PS Let me know if any help is needed as the PR has some volume 👍 |
Screen.Recording.2024-04-03.at.7.17.59.PM.mov@kacper-mikolajczak The LHN is not reordering correctly. |
@shubham1206agra Fixed ✅ |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-04.at.7.46.23.PM.movAndroid: mWeb ChromeScreen.Recording.2024-04-04.at.7.15.34.PM.moviOS: NativeScreen.Recording.2024-04-04.at.7.32.42.PM.moviOS: mWeb SafariScreen.Recording.2024-04-04.at.7.09.29.PM.movMacOS: Chrome / SafariScreen.Recording.2024-04-04.at.7.02.45.PM.movMacOS: DesktopScreen.Recording.2024-04-04.at.7.24.22.PM.mov |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #37880 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Please fix conflicts and make sure tests are passing, thanks! |
Hi @AndrewGable 👋
Conflicts resolved ✅
The failing performance test is expected to happen (please see explanation here). We can set it as a new baseline 👍 |
Merged with a failing perf-test due to #37281 (comment) |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.4.61-0 🚀
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.4.61-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
|
Details
This PR is part of the Callstack performance audit. It aims to remove
hasDraft
property fromReport
model and re-use existing collection ofONYXKEY.COLLECTION.REPORT_DRAFT_COMMENT
to serve the same functionality. It tries to remove overhead coming from calculating draft status when writing a message in the composer.Fixed Issues
$ #37880
PROPOSAL: https://expensify.slack.com/archives/C05LX9D6E07/p1709036231433249
Tests
pencil
icon is correctly displayedOffline tests
QA Steps
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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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.mp4
Android: mWeb Chrome
androidweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
iosweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4