Skip to content

[HOLD for payment 2024-07-17] [$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline #43560

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when validating #43020
Version Number: 1.4.82-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go offline.
  3. Go to Self DM.
  4. Track an expense.
  5. Go to transaction thread.
  6. Delete the expense.
  7. Back in 1:1 DM, click on any option in actionable whisper.

Expected Result:

The actionable whisper should not be interactable when the expense is deleted offline.

Actual Result:

The actionable whisper is interactable when the expense is deleted offline and the options (except Nothing for now) lead to not here page.

Workaround:

unknown

Platforms:

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

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

Screenshots/Videos

Bug6510127_1718153439897.20240612_084634.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0102bf6b299104a911
  • Upwork Job ID: 1801628978700613798
  • Last Price Increase: 2024-06-14
  • Automatic offers:
    • rojiphil | Reviewer | 102784394
    • truph01 | Contributor | 102784396
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

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

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. m-natarajan commented on Jun 12, 2024

    @m-natarajan
    Author

    @CortneyOfstad 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. m-natarajan commented on Jun 12, 2024

    @m-natarajan
    Author

    We think that this bug might be related to #vip-vsb

  5. Krishna2323 commented on Jun 12, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Actionable whisper - Whisper options are interactable when the expense is deleted offline

    What is the root cause of that problem?

    We don't have any logic to disable the buttons when the transaction is deleted.

    const actionableItemButtons: ActionableItem[] = useMemo(() => {
    if (!isActionableWhisper && (!ReportActionsUtils.isActionableJoinRequest(action) || action.originalMessage.choice !== ('' as JoinWorkspaceResolution))) {
    return [];
    }
    if (ReportActionsUtils.isActionableTrackExpense(action)) {
    const transactionID = action?.originalMessage?.transactionID;
    return [
    {
    text: 'actionableMentionTrackExpense.submit',
    key: `${action.reportActionID}-actionableMentionTrackExpense-submit`,
    onPress: () => {
    ReportUtils.createDraftTransactionAndNavigateToParticipantSelector(transactionID, report.reportID, CONST.IOU.ACTION.SUBMIT, action.reportActionID);
    },
    isMediumSized: true,
    },
    {

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

    We should get the transaction using transactionID and if the transaction doesn't exist, we will disable the buttons. In order to make this work we need to follow few steps.

    1. Get all transactions using useOnyx in ReportActionItem.
    const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION);
    1. Get the transaction details using the transactionID.
    const transactionID = action?.originalMessage?.transactionID;
    const transaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`] ?? null;

    const actionableItemButtons: ActionableItem[] = useMemo(() => {
    if (!isActionableWhisper && (!ReportActionsUtils.isActionableJoinRequest(action) || action.originalMessage.choice !== ('' as JoinWorkspaceResolution))) {
    return [];
    }
    if (ReportActionsUtils.isActionableTrackExpense(action)) {
    const transactionID = action?.originalMessage?.transactionID;
    return [
    {
    text: 'actionableMentionTrackExpense.submit',

    3. Add isDisabled property in the objects in actionableItemButtons array.

    {
        text: 'actionableMentionTrackExpense.submit',
        key: `${action.reportActionID}-actionableMentionTrackExpense-submit`,
        onPress: () => {
            ReportUtils.createDraftTransactionAndNavigateToParticipantSelector(transactionID, report.reportID, CONST.IOU.ACTION.SUBMIT, action.reportActionID);
        },
        isMediumSized: true,
        isDisabled: !transactions,
    },
    1. Update ActionableItemButtton to pass the isDisabled prop.
      <Button
      key={item.key}
      onPress={item.onPress}
      text={translate(item.text)}
      small={!item.isMediumSized}
      medium={item.isMediumSized}
      success={item.isPrimary}
      />
      ))}
    <Button
        key={item.key}
        onPress={item.onPress}
        text={translate(item.text)}
        small={!item.isMediumSized}
        medium={item.isMediumSized}
        success={item.isPrimary}
        isDisabled={item.isDisabled}
    />

    Optional: We can wrap the Whisper message with OfflineWithFeedback.

    <ReportActionItemSingle

    <OfflineWithFeedback pendingAction={ReportActionsUtils.isActionableTrackExpense(action) && !transaction && 'delete'}>

    Note: We also need to update the type files.

    What alternative solutions did you explore? (Optional)

    1. We can also get the action transaction using the withOnyx HOC.
    2. Instead of making the buttons disabled we can hide the buttons by returning empty array if transaction is falsy value.

    Result

    Monosnap.screencast.2024-06-12.21-08-45.mp4
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 14, 2024
  7. changed the title [-]Actionable whisper - Whisper options are interactable when the expense is deleted offline[/-] [+][$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline[/+] on Jun 14, 2024
  8. melvin-bot commented on Jun 14, 2024

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

    @melvin-bot

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

  11. 36 remaining items

  12. melvin-bot commented on Jul 10, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-07-17. 🎊

    For reference, here are some details about the assignees on this issue:

  13. melvin-bot commented on Jul 10, 2024

    @melvin-bot

    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:

    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR:
    • [@rojiphil] 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:
    • [@rojiphil] 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:
    • [@rojiphil] Determine if we should create a regression test for this bug.
    • [@rojiphil] 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.
    • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  14. changed the title [-][HOLD for payment 2024-07-17] [$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline[/-] [+][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline[/+] on Jul 15, 2024
  15. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-07-22. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    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:

    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR:
    • [@rojiphil] 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:
    • [@rojiphil] 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:
    • [@rojiphil] Determine if we should create a regression test for this bug.
    • [@rojiphil] 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.
    • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. CortneyOfstad commented on Jul 18, 2024

    @CortneyOfstad
    Contributor

    So the title is incorrect and this needs to be paid.

    @rojiphil can you please complete the checklist by EOD? Thank you and sorry for the short notice!

  18. changed the title [-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline[/-] [+][HOLD for payment 2024-07-17] [$250] Actionable whisper - Whisper options are interactable when the expense is deleted offline[/+] on Jul 18, 2024
  19. rojiphil commented on Jul 19, 2024

    @rojiphil
    Contributor
    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
    • [@rojiphil] 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: Added comment
    • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
    • [@rojiphil] Determine if we should create a regression test for this bug. : Since this feature was not implemented before, we can add the test case to the existing list of test cases for this track expense feature.
    • [@rojiphil] 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.

    Test Steps
    1 Go offline.
    2 Navigate to Self DM.
    3 Track an expense.
    4 Go to transaction thread.
    5 Delete the expense.
    6 Verify that the actionable whisper is not displayed.

  20. rojiphil commented on Jul 19, 2024

    @rojiphil
    Contributor

    can you please complete the checklist by EOD?

    @CortneyOfstad Checklist is done.

  21. CortneyOfstad commented on Jul 19, 2024

    @CortneyOfstad
    Contributor

    Payment Summary

    @rojiphil — paid $250 via Upwork
    @truph01 — paid $250 via Upwork

    Regression Test

    https://github.com/Expensify/Expensify/issues/414055

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