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
[Due for payment 2026-06-23] [$250] Spend- Inline merchant field is not disabled for unreported per diem expense and can be edited #91136
Version Number: 9.3.78-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#89166 Email or phone of affected tester (no customers):injdojsodjdosjdoisd@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:
Precondition:
Workspace has per diem rates.
Go to staging.new.expensify.com
Go to workspace chat.
Create a per diem expense.
Go to Spend > Expenses.
Hover over inline merchant field on the per diem expense.
→ Merchant inline field is disabled for per diem expense - Expected.
Open the report.
Click Report > Remove from report.
Click on the inline merchant field on the per diem expense.
Expected Result:
Inline merchant field should be disabled for unreported per diem expense.
Actual Result:
Inline merchant field is not disabled for unreported per diem expense and it can be edited.
The inline merchant field editability is determined by canEditRestricted inside getTransactionEditPermissions. For the MERCHANT field, it checks for distance requests and scanning (lines 429-438) but has no per diem check. It then falls through to a generic return at line 464:
When the expense is unreported, isUnreported short-circuits to true — canEditFieldOfMoneyRequest is never called, so the per diem guard in ReportUtils.ts:4926-4931 is bypassed entirely.
What changes do you think we should make in order to solve the problem?
Add a per diem check in canEditRestricted for the MERCHANT field in TransactionInlineEdit.ts, alongside the existing distance and scanning checks:
Import isPerDiemRequest from @libs/TransactionUtils
Add if (isPerDiemRequest(transaction)) { return false; } inside the MERCHANT field block (after the scanning check at line 438)
This mirrors how distance requests are already handled — returning false early before the isUnreported short-circuit can apply.
What alternative solutions did you explore?
Could change the generic fallback at line 464 to always call canEditFieldOfMoneyRequest even for unreported expenses. However, that would change behavior for all field types for unreported expenses, not just per diem merchant. The targeted fix in the MERCHANT block is safer and consistent with how isDistanceRequest is already handled there.
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.
Please re-state the problem that we are trying to solve in this issue.
On the Spend/Expenses page, the inline merchant field is editable for a per diem expense once it's been removed from a report (unreported). It correctly stays disabled while the expense is on a report.
What is the root cause of that problem?
The inline edit permissions are computed in getTransactionEditPermissions inside TransactionInlineEdit.ts. For the merchant field, the only per-field guards are "distance request" and "scanning" — there is no per diem guard. When the expense is reported, the per diem block lives inside canEditFieldOfMoneyRequest (ReportUtils, lines 4926-4931) and correctly returns false. But for unreported expenses, the code short-circuits with isUnreported || canEditFieldOfMoneyRequest(...), so that per diem check is bypassed entirely.
// Distance expenses cannot have their merchant edited
if(isDistanceRequest(transaction)){
returnfalse;
}
// Merchant field shows "Scanning..." during SmartScan
if(isTransactionScanning){
returnfalse;
}
}
What changes do you think we should make in order to solve the problem?
In the MERCHANT branch of canEditRestricted inside getTransactionEditPermissions, add an isPerDiemRequest(transaction) guard alongside the existing isDistanceRequest and isTransactionScanning checks so it returns false for per diem regardless of reported/unreported state. isPerDiemRequest is already exported from @libs/TransactionUtils — just import and use it next to the existing isDistanceRequest import.
🚨 Edited by proposal-police: This proposal was edited at 2026-05-20 05:11:02 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a workspace with per diem rates, the inline merchant field of a per diem expense is correctly disabled in Spend → Expenses while the expense is on a report, but becomes editable once the expense is removed from its report (unreported). It should stay disabled in both states.
What is the root cause of that problem?
Inline-edit permissions for the Spend/report transaction tables are computed by getTransactionEditPermissions → canEditRestricted, added in PR #89166 (merged 2026-05-14). That function re-derives a subset of the transaction-intrinsic field locks per field — distance and SmartScan — but never per diem:
The || short-circuits the moment isUnreported is true, so for an unreported expense canEditFieldOfMoneyRequest is never called and its per diem lock is skipped. While the expense is on a report, isUnreported is false, the canonical check runs, and the field is correctly disabled — which is exactly why the bug only appears after Remove from report.
This is not merchant-specific. The AMOUNT branch has the identical shape (split + scanning only, no per diem), and canEditAmount feeds the same kind of inline cell as merchant (TransactionItemRowWide.tsx#L416). So the same short-circuit also leaves the amount cell editable for an unreported per diem expense — a second leak from one root cause. (Currency has no separate inline cell; it rides the amount cell.)
What changes do you think we should make in order to solve the problem?
Restore the transaction-intrinsic lock the short-circuit bypasses, at the single place it belongs — the top of canEditRestricted — so it mirrors canEditFieldOfMoneyRequest and runs before the isUnreported fallback, covering both leaking cells at once:
const canEditRestricted = (field: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>) => {
+ // Per diem amount/currency/merchant are derived from the rate and are never editable,+ // regardless of report state. Mirror canEditFieldOfMoneyRequest so the isUnreported+ // fallback below can't leak these fields for an unreported per diem expense.+ if (isPerDiemRequest(transaction) && (field === CONST.EDIT_REQUEST_FIELD.AMOUNT || field === CONST.EDIT_REQUEST_FIELD.MERCHANT)) {+ return false;+ }+
if (field === CONST.EDIT_REQUEST_FIELD.AMOUNT) {
isPerDiemRequest is already exported from @libs/TransactionUtils — add it to the existing import on L30. It keys off iouRequestType/comment.type and never reads reportID (L269-L275), so it returns the same answer for reported, unreported, and in-flight optimistic per diem transactions; the cell stays disabled across the remove-from-report optimistic transition and any rollback.
I scope the guard to AMOUNT and MERCHANT (not DATE/category/tag/description) because that is exactly the set canEditFieldOfMoneyRequest locks for per diem — no more, no less.
What alternative solutions did you explore? (Optional)
Add isPerDiemRequest only to the MERCHANT branch. Fixes the reported symptom but leaves the amount inline cell editable for the same unreported per diem expense, since the AMOUNT branch shares the defect. A single guard mirroring the canonical rule fixes both fields at once and keeps the inline layer aligned with the one source of truth.
Drop the isUnreported || short-circuit and always call canEditFieldOfMoneyRequest. Rejected: the short-circuit is intentional (see the comment block directly above it) — canEditFieldOfMoneyRequest gates on canEditMoneyRequest, which can return false for unreported expenses whose parentReportAction isn't hydrated in Onyx yet (common in Search). Removing it would regress inline editing of every field for those expenses — far wider blast radius than this bug.
changed the title [-]Spend- Inline merchant field is not disabled for unreported per diem expense and can be edited[/-][+][$250] Spend- Inline merchant field is not disabled for unreported per diem expense and can be edited[/+]on May 19, 2026
⚠️@wildan-m Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Closing, @parasharrajat , if payment is supposed to be reduced somewhere, please post there. 3 issues linked in the OP of the offending PR (from what I can tell)
Activity
applause-bot commentedon May 19, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/879e382787c4d83169ed6f3650065725e2b39844847ce8ba48625411ec7df4a2
MelvinBot commentedon May 19, 2026
Proposal
What is the root cause of that problem?
The inline merchant field editability is determined by
canEditRestrictedinsidegetTransactionEditPermissions. For theMERCHANTfield, it checks for distance requests and scanning (lines 429-438) but has no per diem check. It then falls through to a generic return at line 464:When the expense is unreported,
isUnreportedshort-circuits totrue—canEditFieldOfMoneyRequestis never called, so the per diem guard inReportUtils.ts:4926-4931is bypassed entirely.What changes do you think we should make in order to solve the problem?
Add a per diem check in
canEditRestrictedfor theMERCHANTfield inTransactionInlineEdit.ts, alongside the existing distance and scanning checks:isPerDiemRequestfrom@libs/TransactionUtilsif (isPerDiemRequest(transaction)) { return false; }inside theMERCHANTfield block (after the scanning check at line 438)This mirrors how distance requests are already handled — returning
falseearly before theisUnreportedshort-circuit can apply.What alternative solutions did you explore?
Could change the generic fallback at line 464 to always call
canEditFieldOfMoneyRequesteven for unreported expenses. However, that would change behavior for all field types for unreported expenses, not just per diem merchant. The targeted fix in theMERCHANTblock is safer and consistent with howisDistanceRequestis already handled there.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.MobileMage commentedon May 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Spend/Expenses page, the inline merchant field is editable for a per diem expense once it's been removed from a report (unreported). It correctly stays disabled while the expense is on a report.
What is the root cause of that problem?
The inline edit permissions are computed in
getTransactionEditPermissionsinsideTransactionInlineEdit.ts. For the merchant field, the only per-field guards are "distance request" and "scanning" — there is no per diem guard. When the expense is reported, the per diem block lives insidecanEditFieldOfMoneyRequest(ReportUtils, lines 4926-4931) and correctly returns false. But for unreported expenses, the code short-circuits withisUnreported || canEditFieldOfMoneyRequest(...), so that per diem check is bypassed entirely.App/src/libs/actions/TransactionInlineEdit.ts
Lines 429 to 439 in 4a67919
What changes do you think we should make in order to solve the problem?
In the
MERCHANTbranch ofcanEditRestrictedinsidegetTransactionEditPermissions, add anisPerDiemRequest(transaction)guard alongside the existingisDistanceRequestandisTransactionScanningchecks so it returnsfalsefor per diem regardless of reported/unreported state.isPerDiemRequestis already exported from@libs/TransactionUtils— just import and use it next to the existingisDistanceRequestimport.App/src/libs/actions/TransactionInlineEdit.ts
Lines 429 to 439 in 4a67919
What alternative solutions did you explore? (Optional)
N/A
yusufdeveloper2903 commentedon May 19, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-20 05:11:02 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a workspace with per diem rates, the inline merchant field of a per diem expense is correctly disabled in Spend → Expenses while the expense is on a report, but becomes editable once the expense is removed from its report (unreported). It should stay disabled in both states.
What is the root cause of that problem?
Inline-edit permissions for the Spend/report transaction tables are computed by
getTransactionEditPermissions→canEditRestricted, added in PR #89166 (merged 2026-05-14). That function re-derives a subset of the transaction-intrinsic field locks per field — distance and SmartScan — but never per diem:App/src/libs/actions/TransactionInlineEdit.ts
Lines 429 to 438 in 4a67919
The canonical rule lives in
canEditFieldOfMoneyRequest, which locks AMOUNT, CURRENCY and MERCHANT for a per diem request:App/src/libs/ReportUtils.ts
Lines 4926 to 4931 in 4a67919
canEditRestrictedonly consults that canonical rule through its generic fallback, and the fallback isisUnreported || canEditFieldOfMoneyRequest(...):App/src/libs/actions/TransactionInlineEdit.ts
Lines 463 to 474 in 4a67919
The
||short-circuits the momentisUnreportedistrue, so for an unreported expensecanEditFieldOfMoneyRequestis never called and its per diem lock is skipped. While the expense is on a report,isUnreportedisfalse, the canonical check runs, and the field is correctly disabled — which is exactly why the bug only appears after Remove from report.This is not merchant-specific. The AMOUNT branch has the identical shape (split + scanning only, no per diem), and
canEditAmountfeeds the same kind of inline cell as merchant (TransactionItemRowWide.tsx#L416). So the same short-circuit also leaves the amount cell editable for an unreported per diem expense — a second leak from one root cause. (Currency has no separate inline cell; it rides the amount cell.)What changes do you think we should make in order to solve the problem?
Restore the transaction-intrinsic lock the short-circuit bypasses, at the single place it belongs — the top of
canEditRestricted— so it mirrorscanEditFieldOfMoneyRequestand runs before theisUnreportedfallback, covering both leaking cells at once:const canEditRestricted = (field: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>) => { + // Per diem amount/currency/merchant are derived from the rate and are never editable, + // regardless of report state. Mirror canEditFieldOfMoneyRequest so the isUnreported + // fallback below can't leak these fields for an unreported per diem expense. + if (isPerDiemRequest(transaction) && (field === CONST.EDIT_REQUEST_FIELD.AMOUNT || field === CONST.EDIT_REQUEST_FIELD.MERCHANT)) { + return false; + } + if (field === CONST.EDIT_REQUEST_FIELD.AMOUNT) {isPerDiemRequestis already exported from@libs/TransactionUtils— add it to the existing import on L30. It keys offiouRequestType/comment.typeand never readsreportID(L269-L275), so it returns the same answer for reported, unreported, and in-flight optimistic per diem transactions; the cell stays disabled across the remove-from-report optimistic transition and any rollback.I scope the guard to AMOUNT and MERCHANT (not DATE/category/tag/description) because that is exactly the set
canEditFieldOfMoneyRequestlocks for per diem — no more, no less.What alternative solutions did you explore? (Optional)
isPerDiemRequestonly to the MERCHANT branch. Fixes the reported symptom but leaves the amount inline cell editable for the same unreported per diem expense, since the AMOUNT branch shares the defect. A single guard mirroring the canonical rule fixes both fields at once and keeps the inline layer aligned with the one source of truth.isUnreported ||short-circuit and always callcanEditFieldOfMoneyRequest. Rejected: the short-circuit is intentional (see the comment block directly above it) —canEditFieldOfMoneyRequestgates oncanEditMoneyRequest, which can returnfalsefor unreported expenses whoseparentReportActionisn't hydrated in Onyx yet (common in Search). Removing it would regress inline editing of every field for those expenses — far wider blast radius than this bug.melvin-bot commentedon May 19, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)wildan-m commentedon May 19, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
melvin-bot commentedon May 19, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022056876234388678706
[-]Spend- Inline merchant field is not disabled for unreported per diem expense and can be edited[/-][+][$250] Spend- Inline merchant field is not disabled for unreported per diem expense and can be edited[/+]github-actions commentedon May 19, 2026
34 remaining items
parasharrajat commentedon Jun 17, 2026
Regression issue
melvin-bot commentedon Jun 17, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
parasharrajat commentedon Jun 19, 2026
@mallenexpensify We can close this as it as a regression issue.
melvin-bot commentedon Jun 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 22, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Jun 24, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mallenexpensify commentedon Jun 25, 2026
Closing, @parasharrajat , if payment is supposed to be reduced somewhere, please post there. 3 issues linked in the OP of the offending PR (from what I can tell)