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.58k stars 2.92k forks source link

[$250] Invoices - No sound when paying invoice #52792

Open lanitochka17 opened 6 days ago

lanitochka17 commented 6 days 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: 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:

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?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/b4a182fe-7456-4275-b1b5-76e08299c4ef

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: @rushatgabhane
melvin-bot[bot] commented 6 days ago

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 commented 6 days ago

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: https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/ReportActionItem/ReportPreview.tsx#L204-L226

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 commented 6 days ago

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

https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/SettlementButton/index.tsx#L217 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 https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/SettlementButton/index.tsx#L156 https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/SettlementButton/index.tsx#L140

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 https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/SettlementButton/index.tsx#L156 https://github.com/Expensify/App/blob/2fe1a064b38a9422dc58b6675fa51de6ef13bfc2/src/components/SettlementButton/index.tsx#L140

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 commented 6 days ago

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. https://github.com/Expensify/App/blob/9368566b52364a34747d8f97d3de7f427b3e0712/src/components/SettlementButton/index.tsx#L216-L219

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. https://github.com/Expensify/App/blob/9368566b52364a34747d8f97d3de7f427b3e0712/src/components/SettlementButton/index.tsx#L129-L143

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

Similar to https://github.com/Expensify/App/issues/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.

https://github.com/Expensify/App/blob/517ffaaf4aad021872c8c9f1b7e73ae8366fb5ca/src/libs/actions/Task.ts#L408-L409

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.

melvin-bot[bot] commented 5 days ago

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

melvin-bot[bot] commented 5 days ago

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