Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[$250] Android-IOU-Tapping thread reply of expense hold offline, hmm not here displayed briefly #49268

Open IuliiaHerets opened 2 weeks ago

IuliiaHerets commented 2 weeks ago

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: V9. 0.35-0 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app
  2. Open 1:1 with an user
  3. Go offline
  4. Create a expense
  5. Long press the expense to hold and unhold the expense
  6. Open the expense
  7. Tap header -- delete expense
  8. Go online
  9. Note deleted message with thread reply displayed little delay
  10. Tap on reply

Expected Result:

Tapping thread reply of expense hold offline, hmm not here must not be displayed briefly.

Actual Result:

Tapping thread reply of expense hold offline, hmm not here displayed briefly.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/4ad47104-3a16-4692-9976-cad4b1a72bcd

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021837165313806139268
  • Upwork Job ID: 1837165313806139268
  • Last Price Increase: 2024-09-27
Issue OwnerCurrent Issue Owner: @akinwale
melvin-bot[bot] commented 2 weeks ago

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

IuliiaHerets commented 2 weeks ago

@muttmuure FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

nkdengineer commented 1 week ago

@IuliiaHerets The video in OP doesn't match the step. Can you please update the video?

muttmuure commented 1 week ago

No overdue

IuliiaHerets commented 1 week ago

Uploaded a correct video, sorry for it

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

nkdengineer commented 5 days ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Tapping thread reply of expense hold offline, hmm not here displayed briefly.

What is the root cause of that problem?

  1. When we hold the transaction, we have an add comment but we don't update the childVisibleActionCount of parent report action then when we delete the money request, the iouReport is marked as pending delete in offline and it's cleared in success data here

https://github.com/Expensify/App/blob/48e9c176b3111870ebe5e6193312334e32c249ea/src/libs/actions/IOU.ts#L5956-L5960

What changes do you think we should make in order to solve the problem?

When we hold a transaction here, we should update parentReportAction in optimistic data by using getOptimisticDataForParentReportAction function as we do in other places

const optimisticParentReportActions = ReportUtils.getOptimisticDataForParentReportAction(reportID, currentTime, 'add');
optimisticParentReportActions.forEach((optimisticParentReportAction) => {
    if (!optimisticParentReportAction) {
        return;
    }
    optimisticData.push(optimisticParentReportAction);
});

https://github.com/Expensify/App/blob/48e9c176b3111870ebe5e6193312334e32c249ea/src/libs/actions/IOU.ts#L7837

We also have another problem after doing that, the expense report still displays as the combined report. The RCA is we don't check the singleAction is deleted or not. To fix that we should return early if the singleAction is deleted

if (((originalMessage?.deleted ?? '') !== '' || isDeletedAction(singleAction)) && isMoneyRequestAction(singleAction)) {
    return;
}

https://github.com/Expensify/App/blob/48e9c176b3111870ebe5e6193312334e32c249ea/src/libs/ReportActionsUtils.ts#L1049

What alternative solutions did you explore? (Optional)

Result

https://github.com/user-attachments/assets/650d6e11-f34a-4d70-92aa-a9ec9cb16729

muttmuure commented 5 days ago

@akinwale proposal above for you

melvin-bot[bot] commented 3 days ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 2 hours ago

@akinwale, @muttmuure Eep! 4 days overdue now. Issues have feelings too...