App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Expense-Reimbursable toggle is disabled when opening expense in Reports first time

Open nlemma opened this issue 1 month ago β€’ 18 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.2.75-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: https://test-management.browserstack.com/projects/2219752/folder/13176922/test-cases/41237504 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: MacBook Air 15.6.1 Chrome, iPhone 15 iOS 26.1 Safari App Component: Money Requests

Action Performed:

  1. Sign in to ND
  2. Create a workspace
  3. Navigate to the workspace chat, create two expenses, do not open them
  4. Open Reports tab - Expenses, click any of the two expenses from step 3

Expected Result:

Reimbursable toggle is enabled in expense details

Actual Result:

Reimbursable toggle is disabled in expense details when opening expense in Reports for the first time

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [x] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [x] MacOS: Chrome / Safari

Screenshots/Videos

https://github.com/user-attachments/assets/d1d9748e-cae5-4386-8368-9570c4028fe4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021999278343449727840
  • Upwork Job ID: 1999278343449727840
  • Last Price Increase: 2025-12-12
Issue OwnerCurrent Issue Owner: @s77rt

nlemma avatar Dec 11 '25 16:12 nlemma

Triggered auto assignment to @jliexpensify (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.

melvin-bot[bot] avatar Dec 11 '25 16:12 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~021999278343449727840

melvin-bot[bot] avatar Dec 12 '25 00:12 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)

melvin-bot[bot] avatar Dec 12 '25 00:12 melvin-bot[bot]

Able to repro!

jliexpensify avatar Dec 12 '25 00:12 jliexpensify

This is highly likely a backend issue , BE team should verify:

  1. Is reimbursable being correctly serialized in the Search API response?
  2. Should reimbursable default to true when not explicitly set (matching frontend behavior)?
  3. Is there a data mapping issue between the transaction table and the Search response?

Symptom

This causes the Reimbursable toggle to show the wrong value (OFF instead of ON) when:

  1. User creates expense with Reimbursable: ON
  2. User navigates to Search
  3. User clicks on an expense from Search results
  4. Frontend merges Search data (with reimbursable: false) into the Transaction store
  5. Toggle displays OFF instead of ON

mavrickdeveloper avatar Dec 12 '25 19:12 mavrickdeveloper

☝️ This makes sense: the FE logic already exists handling fallback value to true, but that only applies when the BE value is either null / undefined:

https://github.com/Expensify/App/blob/3c5a9617a3038beabbafa8c4363657586bf69155/src/libs/TransactionUtils/index.ts#L971-L976

updatedTransaction?.reimbursable is undefined in our case, and we fallback to !!transactionReimbursable = false:

https://github.com/Expensify/App/blob/3c5a9617a3038beabbafa8c4363657586bf69155/src/components/ReportActionItem/MoneyRequestView.tsx#L982-L987

Given this, I think that when opening search page & expense without having open the expense before to hydrate that variable -> we're seeing the value as false which comes from BE since FE logic already handles fallback.

I think this needs somebody from BE to look into it and address.

πŸŽ€πŸ‘€πŸŽ€Β C+ reviewed

ikevin127 avatar Dec 13 '25 00:12 ikevin127

Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Dec 13 '25 00:12 melvin-bot[bot]

Can you make a backend GitHub issue following the template? I will get it added to the backlog once we have a new issue.

AndrewGable avatar Dec 15 '25 17:12 AndrewGable

@AndrewGable Oh Sorry I didn't notice you are already assigned πŸ˜… I have already started working on this and it seems we have two issues:

  1. FE issue that is the reimbursable field is not set correctly optimistically
  2. BE issue that is when we open a transaction thread (that does not exist i.e. it's created on request) we are not returning the linked transaction.

s77rt avatar Dec 15 '25 17:12 s77rt

Ok cool, are you addressing both issues @s77rt ?

AndrewGable avatar Dec 15 '25 18:12 AndrewGable

Yes, should not take long πŸ‘

s77rt avatar Dec 15 '25 18:12 s77rt

Update: Raised PR. Turned out that both issues are internal. PR fixes both.

s77rt avatar Dec 15 '25 20:12 s77rt

@AndrewGable Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 18 '25 23:12 melvin-bot[bot]

No payment needed for this right? Since @ikevin127 didn't review the PR?

jliexpensify avatar Dec 19 '25 00:12 jliexpensify

Yes, since this is Internal only

s77rt avatar Dec 19 '25 00:12 s77rt

@s77rt Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 23 '25 00:12 melvin-bot[bot]

PR still under review (should be ready for merge)

s77rt avatar Dec 23 '25 14:12 s77rt

@AndrewGable @s77rt @jliexpensify @ikevin127 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Dec 25 '25 21:12 melvin-bot[bot]

@s77rt Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 27 '25 00:12 melvin-bot[bot]

Same ^

s77rt avatar Dec 27 '25 07:12 s77rt

@s77rt Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Jan 01 '26 23:01 melvin-bot[bot]