-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix: pasting long text freezes app #49228
Conversation
@c3024 when I tried to test on iOS simulator, it freezes the app on both native and mWeb. Doesn't happen on Android, Desktop and Desktop browser. Could you please check that while doing the review as well? |
Yes, I tried on an iPad also. It freezes mWeb there also. |
Weird, it didn't freeze on Chrome. Let me take a closer look. |
I meant Safari on iPad. |
@c3024 ok I figured out why it is so slow on iOS: It seems like somehow parsing markdown range for text longer than 5000 chars are pretty slow, i.e: The parsing limit on mobile should be 5000 characters or less, not 10000 characters. By the way I notice the live-markdown is being reverted back to 0.1.164 (while my fix is introduced in 0.1.168), so I would love if this is put on hold why I'm asking for live MD team's opinion on benchmarking the performance of |
Upgrade to lib to latest. Will update the iOS videos in a bit. |
@c3024 I added the videos for all platforms, please review the PR again. Thanks |
Reviewer Checklist
Screenshots/VideosAndroid: NativefreezeAndroid.mp4Android: mWeb ChromefreezeAndroidmWeb.mp4iOS: NativefreezeiOS.moviOS: mWeb SafarifreezeiOSmWeb.movMacOS: Chrome / SafarifreezeChrome.movMacOS: DesktopfreezeDesktop.mov |
@dominictb please resolve conflicts. |
I'll resolve in a few hours |
@c3024 I resolved conflicts |
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!
* If maxLength is not set, we should set the it to CONST.MAX_COMMENT_LENGTH + 1, to avoid parsing markdown for large text | ||
* Since we want the ExceededCommentLength to be displayed, we need to set the maxLength to CONST.MAX_COMMENT_LENGTH + 1 |
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.
The second sentence is pretty similar and I don't understand the ExceededCommentLength
bit. Is it possible to merge the two sentences, or am I missing why we need both?
@Julesssss I updated. Can you please review again? |
✋ 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/Julesssss in version: 9.0.76-0 🚀
|
Details
Implement the first part of the solution to prevent pasting when text length exceeds 10000:
App/src/CONST.ts
Line 2747 in 98efbce
Fixed Issues
$ #46766
PROPOSAL: #46766 (comment)
Tests
default.txt
Verify that: the app doesn't freeze
Offline tests
QA Steps
default.txt
Verify that: the app doesn't freeze
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
compressed_android.webm.mp4
Android: mWeb Chrome
compressed_aweb.webm.mp4
iOS: Native
Screen.Recording.2024-11-19.at.11.40.24.mov
iOS: mWeb Safari
Screen.Recording.2024-11-19.at.11.30.20.mov
MacOS: Chrome / Safari
compressed_web_md.mov.mp4
compressed_web_txt.mov.mp4
MacOS: Desktop
compressed_desktop.mov.mp4