Skip to content

[HOLD for payment 2024-10-14] [$250] Expense-Thread message for hold expense not shown in offline #49335

Closed

Description

@IuliiaHerets

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: 9.0.36-1
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Go offline
  3. Open 1:1 DM
  4. Create a expense
  5. Long press the expense and then hold & unhold the expense
  6. Note reply thread not displayed
  7. Open the expense
  8. Note hold expense system message displayed
  9. Go online
  10. Go to conversation page
  11. After going online, thread reply message shown

Expected Result:

Thread message for hold expense must be shown in offline.

Actual Result:

Thread message for hold expense not shown in offline.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6606357_1726561952395.az_recorder_20240917_135453_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838745172566353951
  • Upwork Job ID: 1838745172566353951
  • Last Price Increase: 2024-09-25
  • Automatic offers:
    • FitseTLT | Contributor | 104144996
Issue OwnerCurrent Issue Owner: @anmurali

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 17, 2024
  2. melvin-bot commented on Sep 17, 2024

    @melvin-bot

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

  3. IuliiaHerets commented on Sep 17, 2024

    @IuliiaHerets
    Author

    @anmurali 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

  4. FitseTLT commented on Sep 17, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Expense-Thread message for hold expense not shown in offline

    What is the root cause of that problem?

    In putOnHold here

    App/src/libs/actions/IOU.ts

    Lines 7841 to 7844 in 00bc167

    function putOnHold(transactionID: string, comment: string, reportID: string) {
    const currentTime = DateUtils.getDBTime();
    const createdReportAction = ReportUtils.buildOptimisticHoldReportAction(currentTime);
    const createdReportActionComment = ReportUtils.buildOptimisticHoldReportActionComment(comment, DateUtils.addMillisecondsFromDateTime(currentTime, 1));

    we are only creating the report actions optimistically but not updating the parentReportAction with the necessary data such as childVisibleActionCount ...
    Same problem exists in Unhold too.

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

    In putOnHold we should optimistically update parentReportAction. We can use ReportUtils.getOptimisticDataForParentReportAction to get optimistic data with the necessary props for the parent action and set it to the optimistic data

        const parentReportActionOptimistic = ReportUtils.getOptimisticDataForParentReportAction(reportID, createdReportActionComment.created, CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD);
    
    

    we can also revert the changes on failureData.
    Same should also be done unHoldRequest

        const parentReportActionOptimistic = ReportUtils.getOptimisticDataForParentReportAction(reportID, createdReportActionComment.created, CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD);
    
    

    One related problem I saw here is we are not updating the lastVisibleActionCreated of the report so the app doesn't auto- scroll to the newly created hold report actions so we can set lastVisibleActionCreated of the report optimistically for both hold (createdReportActionComment.created) and unhold (createdReportActionComment.created) cases.

    What alternative solutions did you explore? (Optional)

  5. melvin-bot commented on Sep 20, 2024

    @melvin-bot

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

  6. melvin-bot commented on Sep 24, 2024

    @melvin-bot

    @anmurali Still overdue 6 days?! Let's take care of this!

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 25, 2024
  8. changed the title [-]Expense-Thread message for hold expense not shown in offline[/-] [+][$250] Expense-Thread message for hold expense not shown in offline[/+] on Sep 25, 2024
  9. melvin-bot commented on Sep 25, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 25, 2024
  11. melvin-bot commented on Sep 25, 2024

    @melvin-bot

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

  12. 23 remaining items

  13. FitseTLT commented on Oct 15, 2024

    @FitseTLT
    Contributor

    @anmurali Payment overdue here.

  14. ntdiary commented on Oct 16, 2024

    @ntdiary
    Contributor

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@ntdiary] The PR that introduced the bug has been identified. Link to the PR: N/A
    • [@ntdiary] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
    • [@ntdiary] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: ** N/A**
    • [@ntdiary] Determine if we should create a regression test for this bug. No need
    • [@ntdiary] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/A
    • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

    I think this is a feature we missed during the development of the parent report, rather than a bug introduced by any specific PR. After we fix this, the issue shouldn’t occur again, so regression test won’t be necessary. :)

  15. melvin-bot commented on Oct 17, 2024

    @melvin-bot

    @Beamanator, @ntdiary, @anmurali, @FitseTLT Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. melvin-bot commented on Oct 21, 2024

    @melvin-bot

    @Beamanator, @ntdiary, @anmurali, @FitseTLT Still overdue 6 days?! Let's take care of this!

  17. FitseTLT commented on Oct 22, 2024

    @FitseTLT
    Contributor

    @anmurali Payment overdue here Thx

  18. muttmuure commented on Oct 23, 2024

    @muttmuure
    Contributor

    @FitseTLT paid $250 on Upwork

  19. muttmuure commented on Oct 23, 2024

    @muttmuure
    Contributor

    @ntdiary - $250 for C+

  20. JmillsExpensify commented on Oct 23, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @ntdiary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions