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

[HOLD for payment 2024-12-12] [$250] Invoices - No sound when paying invoice #52792

Open
5 of 8 tasks
lanitochka17 opened this issue Nov 19, 2024 · 21 comments
Open
5 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Overdue

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 19, 2024

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.64-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User has received an invoice
  1. Go to staging.new.expensify.com
  2. Go to invoice room
  3. Pay the invoice via any option

Expected Result:

There should be sound when paying invoice

Actual Result:

There is no sound when paying invoice

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

Add any screenshot/video evidence
Bug6669814_1732038805706.Screen_Recording_20241120_014752_Chrome.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859385613425085004
  • Upwork Job ID: 1859385613425085004
  • Last Price Increase: 2024-11-20
Issue OwnerCurrent Issue Owner: @MitchExpensify
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 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.

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 19:02:17 UTC.

Proposal


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

Invoices - No sound when paying invoice

What is the root cause of that problem?

We aren't calling playSound(SOUNDS.SUCCESS) here:

const confirmPayment = useCallback(
(type: PaymentMethodType | undefined, payAsBusiness?: boolean) => {
if (!type) {
return;
}
setPaymentType(type);
setRequestType(CONST.IOU.REPORT_ACTION_TYPE.PAY);
if (isDelegateAccessRestricted) {
setIsNoDelegateAccessMenuVisible(true);
} else if (ReportUtils.hasHeldExpenses(iouReport?.reportID)) {
setIsHoldMenuVisible(true);
} else if (chatReport && iouReport) {
setIsPaidAnimationRunning(true);
HapticFeedback.longPress();
if (ReportUtils.isInvoiceReport(iouReport)) {
IOU.payInvoice(type, chatReport, iouReport, payAsBusiness);
} else {
IOU.payMoneyRequest(type, chatReport, iouReport);
}
}
},
[chatReport, iouReport, isDelegateAccessRestricted],
);

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


We should play sound playSound(SOUNDS.DONE) or playSound(SOUNDS.SUCCESS) before IOU.payInvoice.

What alternative solutions did you explore? (Optional)

Result

@Nodebrute
Copy link
Contributor

Nodebrute commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 19:15:29 UTC.

Proposal

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

No sound when paying invoice

What is the root cause of that problem?

The sounds work as expected when paying someone, but they do not trigger for invoices. This is because the sound is played when selecting the payment type

playSound(SOUNDS.SUCCESS);

But no sound is played when the button is pressed for the "Pay Elsewhere" option in invoices because here we are not playing any sound
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, true),

onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE),

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

We should add playSound(SOUNDS.SUCCESS); for these two cases too

onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, true),

onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE),

We can do something like this

      onSelected: () => {
                            playSound(SOUNDS.SUCCESS);
                            onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, true);
                        },

Optional: We can play sound of our choice. For example Done sound

What alternative solutions did you explore? (Optional)

@bernhardoj
Copy link
Contributor

Proposal

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

Pressing the invoice pay button doesn't play a sound.

What is the root cause of that problem?

For non-invoice, when we press the pay button, it will call selectPaymentType which plays the sound if there is no held expenses.

if (!ReportUtils.hasHeldExpenses(iouReport?.reportID)) {
playSound(SOUNDS.SUCCESS);
}
onPress(iouPaymentType);

But for invoice, it will show a popover menu which when we select the individual > pay elsewhere option, it only calls the SettlementButton onPress without playing any sound.

if (ReportUtils.isIndividualInvoiceRoom(chatReport)) {
buttonOptions.push({
text: translate('iou.settlePersonal', {formattedAmount}),
icon: Expensicons.User,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
backButtonText: translate('iou.individual'),
subMenuItems: [
{
text: translate('iou.payElsewhere', {formattedAmount: ''}),
icon: Expensicons.Cash,
value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
},
],
});

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

Similar to #50572, I suggested to play the sound inside the pay function, such as payMoneyRequest, payInvoice, sendMoneyElsewhere, and sendMoneyWithWallet. We will follow the same pattern as completing a task. If we want to handle this for payInvoice, then we can only do it for payInvoice.

playSound(SOUNDS.SUCCESS);
API.write(WRITE_COMMANDS.COMPLETE_TASK, parameters, {optimisticData, successData, failureData});

If we want to apply to all pay, then we need to remove the play sound from some places like in SettlementButton to not have duplicated sound.

@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Nov 20, 2024
@melvin-bot melvin-bot bot changed the title Invoices - No sound when paying invoice [$250] Invoices - No sound when paying invoice Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

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

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

melvin-bot bot commented Nov 20, 2024

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

Copy link

melvin-bot bot commented Nov 26, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 26, 2024
@rushatgabhane
Copy link
Member

rushatgabhane commented Nov 26, 2024

i like @bernhardoj's proposal

it makes sense to play the sounds in an api action more than doing it in ui component

🎀 👀 🎀

Copy link

melvin-bot bot commented Nov 26, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 26, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 26, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @rushatgabhane

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 5, 2024
@melvin-bot melvin-bot bot changed the title [$250] Invoices - No sound when paying invoice [HOLD for payment 2024-12-12] [$250] Invoices - No sound when paying invoice Dec 5, 2024
Copy link

melvin-bot bot commented Dec 5, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 5, 2024
Copy link

melvin-bot bot commented Dec 5, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.71-2 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-12-12. 🎊

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

Copy link

melvin-bot bot commented Dec 5, 2024

@rushatgabhane @MitchExpensify @rushatgabhane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@MitchExpensify
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@MitchExpensify
Copy link
Contributor

cc @rushatgabhane To complete the C+ steps above

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

Payment Summary

Upwork Job

BugZero Checklist (@MitchExpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1859385613425085004/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@MitchExpensify
Copy link
Contributor

All payments coming through NewDot, closing

@MitchExpensify
Copy link
Contributor

Sorry, reopening - @rushatgabhane please complete the BZ steps

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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

melvin-bot bot commented Dec 16, 2024

@rushatgabhane, @mountiny, @MitchExpensify, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Overdue
Projects
None yet
Development

No branches or pull requests

8 participants