Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: Vo.2.24-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-1162/folder/13176681/41236983/936935226
Email or phone of affected tester (no customers): Slottwo1 mployee@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13 phone
App Component: Chat Report View
Action Performed:
- Launch app
- Open a chat
- Paste the message - 6 or 7 times [use error message text]
- Send the message
- Note Compose box remains expanded few seconds
- Scroll the message
Text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sem eros, euismod eu purus quis, feugiat ultricies augue. Fusce scelerisque urna eu felis maximus vestibulum. Proin cursus dictum ipsum sit amet tincidunt. Mauris consectetur condimentum urna ac dictum. Pellentesque viverra enim ut lacus faucibus, id aliquet leo vestibulum. Maecenas tortor orci, dictum at sagittis congue, volutpat ac libero. Maecenas vel rhoncus justo, in finibus nunc. Maecenas sed maximus felis. Nulla lobortis faucibus augue, vitae gravida orci faucibus in. Sed risus augue, malesuada eget porta in, rhoncus sed neque. Integer nibh ex, interdum ut molestie ac, placerat ut tortor. Morbi quis metus quis metus venenatis vehicula ac nec massa. Duis sapien ipsum, euismod sit amet finibus blandit, porttitor lacinia ipsum. Duis convallis mauris risus, in faucibus mi tempus et. Ut ac eros non purus volutpat blandit quis vel ipsum. Vivamus porttitor malesuada imperdiet.
Donec tortor ipsum, pulvinar a posuere sed, rhoncus vitae nisl. Integer lobortis, sem eu ultricies porttitor, enim elit dapibus lacus, a mollis eros diam vitae elit. Sed fermentum facilisis velit, ac consectetur orci efficitur ac. Proin tincidunt nibh nec tellus porttitor, et lacinia nunc viverra. Maecenas porta maximus elit id pharetra. Vivamus scelerisque ante eget metus sollicitudin sagittis. Nulla eget finibus lacus. Suspendisse interdum rhoncus libero in tincidunt. Ut accumsan magna at urna accumsan pulvinar. Vivamus eget nibh iaculis, convallis erat in, vulputate risus. Nullam lobortis, risus eget consectetur semper, dolor libero pretium mi, eu varius libero sapien non odio. Nam laoreet dapibus velit eget interdum.
Maecenas sagittis feugiat sapien, sit amet dapibus dui aliquam a. Donec volutpat ornare augue in pulvinar. Donec sagittis nibh sed ipsum vestibulum consectetur. Vestibulum feugiat, augue eu volutpat gravida, eros felis vulputate nibh, vitae pellentesque felis turpis at nisl. Aenean tempor enim non laoreet iaculis. Maecenas elit ligula, porta id quam a, dapibus viverra urna. Ut in sem in metus eleifend dignissim a non quam. Phasellus in rhoncus massa, ut dictum erat. Cras viverra elit orci, sit amet vestibulum magna condimentum lobortis. Ut vitae libero convallis, commodo mauris sed, suscipit nisi. Morbi vel nibh molestie, ultrices enim quis, dictum orci. Morbi consectetur consequat lacus vel vulputate. Etiam rutrum condimentum elit, vel sollicitudin ante feugiat in.
Nullam egestas velit tortor, sit amet suscipit lacus porta ac. Curabitur feugiat risus quis nulla tempus, non vulputate libero facilisis. Sed eu viverra elit. Etiam massa enim, aliquam in consequat et, eleifend sit amet odio. Aenean pellentesque, dui varius tincidunt malesuada, nunc diam lobortis velit, et vestibulum ex dolor sodales ipsum. Nam at elementum lectus. Nulla nisl ipsum, gravida eu dictum vitae, rhoncus id arcu. Suspendisse ut neque leo.
Expected Result:
User must not be allowed to send more than 15k.
Actual Result:
Message has over 15k characters error is shown after sending the message.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
11.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021975585816698117729
- Upwork Job ID: 1975585816698117729
- Last Price Increase: 2025-10-14
- Automatic offers:
- andriivitiv | Contributor | 109152279
Activity
melvin-bot commentedon Oct 7, 2025
Triggered auto assignment to @clarajones-expensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.andriivitiv commentedon Oct 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
It should not be possible to send a message exceeding 15,000 characters.
What is the root cause of that problem?
The message length validation is wrapped in
lodashDebouncewith a 1.5-second delay. If a user quickly pastes and sends a message, the debounce may not have executed yet, allowing oversized messages to bypass the validation.App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 475 to 485 in ada8947
What changes do you think we should make in order to solve the problem?
We need to validate the message right before sending it.
First, return validation results from validateCommentMaxLength and validateTaskTitleMaxLength (true if the message is valid, otherwise false). Then return the result of these functions from
validateMaxLengthhere.Next, pass the
debouncedValidate.flushfunction tocomposerRefSharedApp/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 641 to 643 in ada8947
Finally, check if the message is valid right before sending it
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 405 to 419 in ada8947
If there is a pending invocation of the debounced function,
debouncedValidate.flush()will invoke it immediately and return its return value. Otherwise, it will return the value from the last invocation.We will also need to apply a similar fix to ReportActionItemMessageEdit.
[-]Chat - Message has over 15k characters error is shown after sending the message[/-][+][$250] Chat - Message has over 15k characters error is shown after sending the message[/+]melvin-bot commentedon Oct 7, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021975585816698117729
melvin-bot commentedon Oct 7, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)zainAwan9175 commentedon Oct 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, users can send messages exceeding the 15,000 character limit.
What is the root cause of that problem?
The root cause is a race condition between validation timing and the send action:
When users paste long text, the
validateCommentMaxLengthfunction is debounced with a 1500ms delay.App/src/hooks/useHandleExceedMaxCommentLength.ts
Lines 9 to 11 in 0400484
The SendButton uses a GestureDetector
App/src/pages/home/report/ReportActionCompose/SendButton.tsx
Lines 29 to 30 in 70c7e2c
On Android, the GestureDetector processes taps immediately at the native level (within 100-300ms after paste),while the debounced validation hasn't completed yet.
When the user taps Send
isSendDisabledis still false because the validation state hasn't updated yet.App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Line 393 in 70c7e2c
The
handleSendMessagefunction only checksisSendDisabledstate, but doesn't validate the actual comment length at send time.App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 401 to 415 in 70c7e2c
This issue is Android-specific because, on Android, the
GestureDetectorfromreact-native-gesture-handlerprocesses taps immediately at the native level, before React state updates can complete.On the web, clicks go through the browser's event system, which gives React more time to process state updates.
What changes do you think we should make in order to solve the problem?
Add synchronous validation in the
handleSendMessagefunction to check the actual comment length before sending, similar to how the edit message flowKey points:
Uses
getDraftComment()to get the current text (works in worklet context)Uses
getCommentLength()the same function the backend uses for validationUses
runOnJS()to safely update React state from the workletReturns early if validation fails, preventing the message from being sent
Result:
WhatsApp.Video.2025-10-12.at.3.42.24.AM.mp4
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Paste long text (>15k chars) and tap Send
Expected: Message is not sent, error message appears, red border shows
What alternative solutions did you explore?
n/A
melvin-bot commentedon Oct 14, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Oct 15, 2025
@hoangzinh Still overdue 6 days?! Let's take care of this!
7 remaining items
melvin-bot commentedon Oct 17, 2025
📣 @andriivitiv 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
hoangzinh commentedon Nov 4, 2025
It looks like automation was broken. The PR has been deployed to Prod early morning #72917 (comment)
[-][$250] Chat - Message has over 15k characters error is shown after sending the message[/-][+][Due for payment 2025-11-04] [$250] Chat - Message has over 15k characters error is shown after sending the message[/+][-][Due for payment 2025-11-04] [$250] Chat - Message has over 15k characters error is shown after sending the message[/-][+][Due for payment 2025-11-10] [$250] Chat - Message has over 15k characters error is shown after sending the message[/+]clarajones-expensify commentedon Nov 13, 2025
Payment Summary
Contributor: @andriivitiv paid $250 via Upwork
Contributor+: @hoangzinh due $250 via NewDot
hoangzinh commentedon Nov 14, 2025
Thanks @clarajones-expensify. I requested in ND
twisterdotcom commentedon Nov 15, 2025
@hoangzinh has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-913e-a7c5-8172-19eda354deb1