Repository navigation
Validate message right before sending - #72917
mjasikowski merged 4 commits into
Conversation
Codecov Report❌ Patch coverage is
... and 245 files with indirect coverage changes 🚀 New features to boost your workflow:
|
2822888 to
b16d297
Compare
| // This will cause onCleared to be triggered where we actually send the message | ||
| clearComposer(); | ||
| }, [isSendDisabled, composerRefShared]); | ||
| runOnUI(() => { |
There was a problem hiding this comment.
Hi @andriivitiv I'm confused. Isn't debouncedValidate.flush() still be triggered at line 399 on native?
There was a problem hiding this comment.
I added .runOnJS(true); in SendButton.tsx so it now runs on the correct thread.
|
@hoangzinh 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-24.at.21.56.12.android.movAndroid: mWeb ChromeScreen.Recording.2025-10-24.at.20.40.14.android.chrome.moviOS: HybridAppScreen.Recording.2025-10-24.at.22.14.42.moviOS: mWeb SafariScreen.Recording.2025-10-24.at.22.07.08.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-10-24.at.20.30.31.web.movMacOS: DesktopScreen.Recording.2025-10-24.at.20.37.14.desktop.mov |
| // This will cause onCleared to be triggered where we actually send the message | ||
| clearComposer(); | ||
| }, [isSendDisabled, composerRefShared]); | ||
| runOnUI(() => { |
There was a problem hiding this comment.
Hi @andriivitiv I'm confused. Isn't debouncedValidate.flush() still be triggered at line 399 on native?
| @@ -1,62 +1,32 @@ | |||
| import {PortalProvider} from '@gorhom/portal'; | |||
| import {NavigationContainer} from '@react-navigation/native'; | |||
| import type * as NativeNavigation from '@react-navigation/native'; | |||
There was a problem hiding this comment.
I found that we removed a lot of code in this spec. Is it safe to remove them?
There was a problem hiding this comment.
Before my changes, the tests were rendering the entire report page, which made it impossible to pass props to ReportActionCompose (such as a mocked onSubmit function to verify it was called). I updated it to render only the ReportActionCompose component, which made some of the existing code in this file unnecessary.
In the end, I didn't pass any props because dispatchCommand() in forceClearInput() was throwing an error. I mocked it instead and kept the changes, since there's no reason to render the entire page anyway. Other tests seems to be working fine.
Not needed anyway because we have a mock
|
✋ 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/mjasikowski in version: 9.2.42-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.42-11 🚀
|

Explanation of Change
Fixes a bug where quickly sending a message longer than the max length could bypass validation because of a 1.5-second debounce delay. This PR ensures validation runs immediately before sending if it has not yet completed.
Fixed Issues
$ #71995
PROPOSAL: #71995 (comment)
Tests
Same as QA Steps
Offline tests
N/A
QA Steps
Repeat these steps on both the main and edit composer:
The maximum comment length is 15,000 characters.error appears under the composer and that the message is not sent/editedPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.standalone.mov
Android: mWeb Chrome
android.mweb.mov
iOS: Native
ios.standalone.mov
iOS: mWeb Safari
android.mweb.mov
MacOS: Chrome / Safari
macos.chrome.mov
MacOS: Desktop
macos.desktop.mov