You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expense - Wrong attachment size limit is shown when uploading from add receipt button #85953
Version Number: 9.3.41-3 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#84497 Email or phone of affected tester (no customers):sdhsiudhishisdihsd@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Add an attachment larger than 25 MB.
→ Error modal shows "Attachment size is larger than 24 MB limit".
Create an expense with receipt.
Open the expense.
Hover over the receipt.
Click Add button.
Add an attachment larger than 25 MB.
→ Error modal shows "Attachment size is larger than 10 MB limit".
Expected Result:
When adding large attachment from add additional receipt button, error modal should display "Attachment size is larger than 24 MB limit".
Actual Result:
When adding large attachment from add additional receipt button, error modal shows "Attachment size is larger than 10 MB limit".
Attachment larger than 10 MB can be uploaded without error.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
When adding a large attachment via the "Add additional receipt" button on an expense's receipt view, the error modal incorrectly shows "Attachment size is larger than 10 MB limit" instead of "Attachment size is larger than 24 MB limit". Files between 10-24 MB are rejected from this button but accepted from the normal attachment flow.
What is the root cause of that problem?
In MoneyRequestReceiptView.tsx, the "Add additional receipt" button calls validateFiles(files) at line 538without passing validationOptions.
The useFilesValidation hook defaults isValidatingReceipts to true (line 20 and line 293). When isValidatingReceipts is true, validation uses CONST.API_ATTACHMENT_VALIDATIONS.RECEIPT_MAX_SIZE (10 MB) instead of CONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZE (24 MB) — see validateAttachmentFile.tsline 33.
However, the "Add additional receipt" button doesn't replace the transaction's receipt — it adds a regular report attachment via addAttachmentWithComment (line 198). This is the same flow as the composer's attachment upload, which correctly passes {isValidatingReceipts: false} at useAttachmentUploadValidation.tsline 180 and uses the 24 MB limit.
What changes do you think we should make in order to solve the problem?
In MoneyRequestReceiptView.tsx, pass {isValidatingReceipts: false} when calling validateFiles from the "Add additional receipt" button, since the files are being added as regular report attachments (not transaction receipts):
Change validateFiles(files) to validateFiles(files, undefined, {isValidatingReceipts: false}) at line 538.
What alternative solutions did you explore? (Optional)
We could change DEFAULT_IS_VALIDATING_RECEIPTS in useFilesValidation.tsx from true to false, but that would affect all callers that currently rely on the default receipt validation behavior (e.g., the scan step, odometer image, share page). The targeted fix is safer.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Classification: Frontend bug Causing PR: #84497 - "fix: resolve deploy blockers and add hover/tooltip to receipt action buttons" by @TaduJR (High confidence) Related Issues: #84356 (the original issue this PR was fixing)
Recommendation: ROLL FORWARD
PR #84497 introduced file validation to the "Add additional receipt" button, but used the wrong validation mode. The fix is simple and low-risk: change one line to pass the correct validation options.
Fix needed: In src/components/ReportActionItem/MoneyRequestReceiptView.tsx line 538, change:
This will correctly apply the 24MB limit instead of the 10MB limit for additional receipts.
Labels: No label changes needed - this is a frontend bug, so DeployBlockerCash should remain.
📋 Detailed Analysis
Evidence
PR #84497 added the useFilesValidation hook to MoneyRequestReceiptView.tsx to validate files before uploading them as additional receipts. However, when calling validateFiles(files) without options, it defaults to isValidatingReceipts: true.
The validation flow:
validateFiles(files) is called without validationOptions parameter (line 538 of MoneyRequestReceiptView.tsx)
This defaults to isValidatingReceipts: DEFAULT_IS_VALIDATING_RECEIPTS which is true (useFilesValidation.tsx line 20)
When isValidatingReceipts: true, the validation uses CONST.API_ATTACHMENT_VALIDATIONS.RECEIPT_MAX_SIZE which is 10MB
When isValidatingReceipts: false, the validation uses CONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZE which is 24MB
Verification
Files affected:
src/components/ReportActionItem/MoneyRequestReceiptView.tsx - where the bug occurs
src/hooks/useFilesValidation.tsx - contains the default behavior
src/libs/validateAttachmentFile.ts - determines which size limit to use based on isValidatingReceipts
Confirmed the PR modifies these files: ✓ Yes, PR #84497 modified MoneyRequestReceiptView.tsx and added the validation logic
Alignment with timeline: ✓ Yes, the issue states this is reproducible in staging (v9.3.41-3), and PR #84497 was merged on 2026-03-18 and is included in the StagingDeployCash checklist
isValidatingReceipts: false - applies 24MB limit (for general attachments)
The "add additional receipt" feature should use the 24MB limit (same as workspace chat attachments), but the code defaults to the 10MB limit. This creates an inconsistent user experience where:
Adding attachment from workspace chat: "24 MB limit" ✓ correct
Activity
melvin-bot commentedon Mar 20, 2026
@puneetlath recently merged #84497, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Mar 20, 2026
Triggered auto assignment to @youssef-lr (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Mar 20, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Mar 20, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Mar 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When adding a large attachment via the "Add additional receipt" button on an expense's receipt view, the error modal incorrectly shows "Attachment size is larger than 10 MB limit" instead of "Attachment size is larger than 24 MB limit". Files between 10-24 MB are rejected from this button but accepted from the normal attachment flow.
What is the root cause of that problem?
In
MoneyRequestReceiptView.tsx, the "Add additional receipt" button callsvalidateFiles(files)at line 538 without passingvalidationOptions.The
useFilesValidationhook defaultsisValidatingReceiptstotrue(line 20 and line 293). WhenisValidatingReceiptsistrue, validation usesCONST.API_ATTACHMENT_VALIDATIONS.RECEIPT_MAX_SIZE(10 MB) instead ofCONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZE(24 MB) — seevalidateAttachmentFile.tsline 33.However, the "Add additional receipt" button doesn't replace the transaction's receipt — it adds a regular report attachment via
addAttachmentWithComment(line 198). This is the same flow as the composer's attachment upload, which correctly passes{isValidatingReceipts: false}atuseAttachmentUploadValidation.tsline 180 and uses the 24 MB limit.What changes do you think we should make in order to solve the problem?
In
MoneyRequestReceiptView.tsx, pass{isValidatingReceipts: false}when callingvalidateFilesfrom the "Add additional receipt" button, since the files are being added as regular report attachments (not transaction receipts):Change
validateFiles(files)tovalidateFiles(files, undefined, {isValidatingReceipts: false})at line 538.What alternative solutions did you explore? (Optional)
We could change
DEFAULT_IS_VALIDATING_RECEIPTSinuseFilesValidation.tsxfromtruetofalse, but that would affect all callers that currently rely on the default receipt validation behavior (e.g., the scan step, odometer image, share page). The targeted fix is safer.Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
OSBotify commentedon Mar 20, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #84497 - "fix: resolve deploy blockers and add hover/tooltip to receipt action buttons" by @TaduJR (High confidence)
Related Issues: #84356 (the original issue this PR was fixing)
Recommendation: ROLL FORWARD
PR #84497 introduced file validation to the "Add additional receipt" button, but used the wrong validation mode. The fix is simple and low-risk: change one line to pass the correct validation options.
Fix needed: In
src/components/ReportActionItem/MoneyRequestReceiptView.tsxline 538, change:to:
This will correctly apply the 24MB limit instead of the 10MB limit for additional receipts.
Labels: No label changes needed - this is a frontend bug, so
DeployBlockerCashshould remain.📋 Detailed Analysis
Evidence
PR #84497 added the
useFilesValidationhook toMoneyRequestReceiptView.tsxto validate files before uploading them as additional receipts. However, when callingvalidateFiles(files)without options, it defaults toisValidatingReceipts: true.The validation flow:
validateFiles(files)is called withoutvalidationOptionsparameter (line 538 of MoneyRequestReceiptView.tsx)isValidatingReceipts: DEFAULT_IS_VALIDATING_RECEIPTSwhich istrue(useFilesValidation.tsx line 20)isValidatingReceipts: true, the validation usesCONST.API_ATTACHMENT_VALIDATIONS.RECEIPT_MAX_SIZEwhich is 10MBisValidatingReceipts: false, the validation usesCONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZEwhich is 24MBVerification
Files affected:
src/components/ReportActionItem/MoneyRequestReceiptView.tsx- where the bug occurssrc/hooks/useFilesValidation.tsx- contains the default behaviorsrc/libs/validateAttachmentFile.ts- determines which size limit to use based onisValidatingReceiptsConfirmed the PR modifies these files: ✓ Yes, PR #84497 modified MoneyRequestReceiptView.tsx and added the validation logic
Alignment with timeline: ✓ Yes, the issue states this is reproducible in staging (v9.3.41-3), and PR #84497 was merged on 2026-03-18 and is included in the StagingDeployCash checklist
Root Cause
The
useFilesValidationhook has two modes:isValidatingReceipts: true- applies 10MB limit (for receipt uploads via expense creation)isValidatingReceipts: false- applies 24MB limit (for general attachments)The "add additional receipt" feature should use the 24MB limit (same as workspace chat attachments), but the code defaults to the 10MB limit. This creates an inconsistent user experience where:
The constants clearly show the intended limits:
Additional receipts should use the general attachment limit (24MB), not the initial receipt limit (10MB).
cristipaval commentedon Mar 20, 2026
Demoting this one
TaduJR commentedon Mar 20, 2026
Investigating...
Assignment here @cristipaval
Thanks!
TaduJR commentedon Mar 20, 2026
@cristipaval
It seems the issue is also repo on Add Attachment from this comment #85951 (comment)
@dukenv0307 Can you confirm #85951 and this issue are interrelated?
TaduJR commentedon Mar 23, 2026
@puneetlath
Can we close this one?
It's being handled here #85951