Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Expense - Amount in expense preview does not match the edited amount in deleted workspace #52896

Open
8 tasks done
izarutskaya opened this issue Nov 21, 2024 · 31 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 21, 2024

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.0.65-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5250638
Email or phone of affected tester (no customers): applausetester [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace.
  3. Go to workspace chat.
  4. Submit an expense.
  5. Delete the workspace.
  6. Go back to the workspace chat.
  7. Click on the expense preview.
  8. Click Amount.
  9. Edit the amount and save it.
  10. Go back to the main workspace chat.

Expected Result:

The amount in the expense preview in the main chat will match the edited amount.

Actual Result:

The amount in the expense preview in the main chat does not match the edited amount.
This issue only happens when the workspace is deleted.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6671714_1732183366430.bandicam_2024-11-21_17-57-31-566.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021860113886210272641
  • Upwork Job ID: 1860113886210272641
  • Last Price Increase: 2024-12-28
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

@huult
Copy link
Contributor

huult commented Nov 21, 2024

Proposal

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

Amount in expense preview does not match the edited amount in deleted workspace

What is the root cause of that problem?

This is a backend issue. I say that because the total in the response is incorrect, so we display it incorrectly

  • Screenshot 2024-11-21 at 22 01 44

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

I think, in this case, I must disable expenses to prevent updates when the workspace is archived, to avoid calculating the wrong value and incorrect logic. Some thing like this:

// src/components/ReportActionItem/MoneyRequestView.tsx#L438
     const isArchivedRoom = ReportUtils.isArchivedRoomWithID(parentReport?.chatReportID);

// src/components/ReportActionItem/MoneyRequestView.tsx#L514
      <MenuItemWithTopDescription
          title={amountTitle}
          shouldShowTitleIcon={isSettled}
          titleIcon={Expensicons.Checkmark}
          description={amountDescription}
          titleStyle={styles.textHeadlineH2}
          interactive={canEditAmount}
          shouldShowRightIcon={canEditAmount}
          onPress={() =>
              Navigation.navigate(
                  ROUTES.MONEY_REQUEST_STEP_AMOUNT.getRoute(
                      CONST.IOU.ACTION.EDIT,
                      iouType,
                      transaction?.transactionID ?? '-1',
                      report?.reportID ?? '-1',
                      '',
                      Navigation.getReportRHPActiveRoute(),
                  ),
              )
          }
          brickRoadIndicator={getErrorForField('amount') ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
          errorText={getErrorForField('amount')}
           disabled={isArchivedRoom}
      />

We will do it like this for the description, date, and so on, if needed.

POC
  • Screenshot 2024-11-21 at 22 32 56

What alternative solutions did you explore? (Optional)

@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Nov 23, 2024
@melvin-bot melvin-bot bot changed the title Expense - Amount in expense preview does not match the edited amount in deleted workspace [$250] Expense - Amount in expense preview does not match the edited amount in deleted workspace Nov 23, 2024
Copy link

melvin-bot bot commented Nov 23, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 23, 2024
Copy link

melvin-bot bot commented Nov 23, 2024

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

@nkdengineer
Copy link
Contributor

Proposal

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

The amount in the expense preview in the main chat does not match the edited amount.
This issue only happens when the workspace is deleted.

What is the root cause of that problem?

We're not disabling edit the money request when the workspace is deleted.

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

We should return false if the chat report is archived or the policy doesn't exist

if (!policy || isArchivedRoom(chatReport)) {
    return false;
}

function canEditMoneyRequest(reportAction: OnyxInputOrEntry<ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.IOU>>, linkedTransaction?: OnyxEntry<Transaction>): boolean {

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
@CyberAndrii
Copy link
Contributor

CyberAndrii commented Nov 25, 2024

Expenses should remain editable even if the workspace is deleted #51164 (comment). This is a BE bug @MitchExpensify.

@rojiphil
Copy link
Contributor

Expenses should remain editable even if the workspace is deleted #51164 (comment).

Thanks @CyberAndrii for the context. This then looks like a BE issue.
Let us also bring the internal engineer to weigh in here and conclude on the way ahead.
🎀👀🎀

@melvin-bot melvin-bot bot removed the Overdue label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

@aldo-expensify
Copy link
Contributor

Asking here to confirm the expected behaviour: #51164 (comment) . Just in case we made that decision to avoid having to work on something we don't care. Now we will have to work in the backend to fix the inconsistency and I would prefer to shift this work to the frontend if we really don't care about the expected behaviour.

@aldo-expensify
Copy link
Contributor

Ok, seems like the expected behaviour is correct here, so I'll investigate why the backend is not modifying the data then.

Copy link

melvin-bot bot commented Nov 30, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 30, 2024
@MitchExpensify MitchExpensify moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 2, 2024
@aldo-expensify
Copy link
Contributor

Can't reproduce in main:

Screen.Recording.2024-12-02.at.6.13.31.PM.mov

Going to try staging...

@melvin-bot melvin-bot bot removed the Overdue label Dec 3, 2024
@aldo-expensify
Copy link
Contributor

In staging I see some currency conversion bug: The amount gets converted to the amount in USD, but it still says CA$:

Screen.Recording.2024-12-02.at.6.17.35.PM.mov

The transaction comes from the backend with the right modifiedAmount: -2500, but the reportAction preview has a value that looks off:

{
    "childCanHold": true,
    "childCanUnhold": false,
    "childCommenterCount": 0,
    "childLastActorAccountID": 18775088,
    "childLastMoneyRequestComment": "",
    "childLastReceiptTransactionIDs": "",
    "childLastVisibleActionCreated": "",
    "childManagerAccountID": 18775088,
    "childMoneyRequestCount": 1,
    "childOldestFourAccountIDs": "",
    "childOwnerAccountID": 18775088,
    "childRecentReceiptTransactionIDs": [],
    "childReportID": 7008012655928011,
    "childReportName": "Expense Report #7008012655928011",
    "childReportNotificationPreference": "hidden",
    "childStateNum": 1,
    "childStatusNum": 1,
    "childType": "expense",
    "childVisibleActionCount": 0,
    "message": [
        {
            "html": " owes C$32.11",
            "text": " owes C$32.11",
            "type": "COMMENT",
            "whisperedTo": []
        }
    ],
    "originalMessage": {
        "isNewDot": true,
        "lastModified": "2024-12-03 02:17:07.709",
        "linkedReportID": "7008012655928011"
    }
}

@aldo-expensify
Copy link
Contributor

hmm, I'm not able to reproduce the currency issue that I saw in staging: #52896 (comment) in dev

@aldo-expensify
Copy link
Contributor

@izarutskaya can you check if this issue is still reproducible? 🙏

Copy link

melvin-bot bot commented Dec 5, 2024

@rojiphil @MitchExpensify @aldo-expensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2024
Copy link

melvin-bot bot commented Dec 6, 2024

@rojiphil, @MitchExpensify, @aldo-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Dec 7, 2024

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

@aldo-expensify aldo-expensify added Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Dec 9, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@aldo-expensify
Copy link
Contributor

Adding Needs Reproduction since I'm failing to reproduce

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 9, 2024
@rojiphil
Copy link
Contributor

Unassigning myself as I don’t think there is anything to be done in FE. But will stay subscribed though. Thanks.

@rojiphil rojiphil removed their assignment Dec 13, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 14, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

@MitchExpensify, @aldo-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Dec 18, 2024

@MitchExpensify, @aldo-expensify Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Dec 19, 2024

@MitchExpensify @aldo-expensify this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@MitchExpensify
Copy link
Contributor

None of us can reproduce, @izarutskaya can you?

@melvin-bot melvin-bot bot removed the Overdue label Dec 19, 2024
Copy link

melvin-bot bot commented Dec 21, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

@MitchExpensify, @aldo-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MitchExpensify MitchExpensify added Weekly KSv2 and removed Daily KSv2 labels Dec 23, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 23, 2024
@MitchExpensify
Copy link
Contributor

Switching to weekly while we wait for reproduction

@izarutskaya
Copy link
Author

izarutskaya commented Dec 27, 2024

@MitchExpensify Tester still can reproduce this issue
Build v9.0.79-0

20241227_162859.mp4

Copy link

melvin-bot bot commented Dec 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

8 participants