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] Held expense - Green payment button appears briefly when paying held expense #53900

Open
3 of 8 tasks
IuliiaHerets opened this issue Dec 11, 2024 · 24 comments
Open
3 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering 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 Overdue Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 11, 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.74-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp #53117
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense.
  4. Go to transaction thread.
  5. Click on the report header > Hold > Hold the expense.
  6. Click on the header subtitle to return to main chat.
  7. Click on the pay button dropdown > Pay elsewhere.
  8. Click Pay elsewhere.
  9. Click Pay all.

Expected Result:

Green payment button will not appear briefly when paying held expense.

Actual Result:

Green payment button appears briefly when paying held expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6690447_1733878631782!Screenshot_2024-12-11_at_08 56 54
Bug6690447_1733876458137.20241211_081228.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866793490879654211
  • Upwork Job ID: 1866793490879654211
  • Last Price Increase: 2024-12-11
Issue OwnerCurrent Issue Owner: @Julesssss
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

Triggered auto assignment to @Julesssss (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Dec 11, 2024

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

Copy link

melvin-bot bot commented Dec 11, 2024

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 11, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 11, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@Julesssss Julesssss added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 11, 2024
@Julesssss
Copy link
Contributor

This is a brief UI issues, so I am removing blocker.

@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Dec 11, 2024
@melvin-bot melvin-bot bot changed the title Held expense - Green payment button appears briefly when paying held expense [$250] Held expense - Green payment button appears briefly when paying held expense Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

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

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

melvin-bot bot commented Dec 11, 2024

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

@mkzie2
Copy link
Contributor

mkzie2 commented Dec 11, 2024

Proposal

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

Green payment button appears briefly when paying held expense.

What is the root cause of that problem?

The button will be displayed with a success color if we don't have any requests that have been held.

shouldUseSuccessStyle={!hasHeldExpenses}

When we pay held expenses, the held transaction is unheld in optimistic data then shouldUseSuccessStyle is changed from false to true briefly while the animation is running.

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

We should delay calling the API a bit to wait until the animation is complete if we paid in full and the startAnimation exist

const shouldDelay = full && !!startAnimation;
if (shouldDelay) {
    setTimeout(() => {
        IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport, full);
    }, CONST.ANIMATION_PAID_DURATION);
} else {
    IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport, full);;
}

IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport, full);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@bernhardoj
Copy link
Contributor

Proposal

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

Pay button becomes green again when the paid animation is running.

What is the root cause of that problem?

The button becomes gray when there are held expenses.

<AnimatedSettlementButton
shouldUseSuccessStyle={!hasHeldExpenses}

When we pay the expense, it becomes unheld, so the button turns green again while the animation is running.

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

We can prevent the button props to be updated. First, create a new ref.

const frozenProps = useRef();

When the animation runs, set the rest of the props to the frozenProps.

useEffect(() => {
if (!isPaidAnimationRunning) {
resetAnimation();
return;
}
buttonScale.set(withTiming(0, {duration: CONST.ANIMATION_PAID_DURATION}));

function AnimatedSettlementButton({isPaidAnimationRunning, onAnimationFinish, isDisabled, ...settlementButtonProps}: AnimatedSettlementButtonProps) {

useEffect(() => {
    if (!isPaidAnimationRunning) {
        frozenProps.current = undefined;
        resetAnimation();
        return;
    }
    frozenProps.current = settlementButtonProps;

Then, pass the frozen props to the settlement button

<SettlementButton
    // eslint-disable-next-line react/jsx-props-no-spreading
    {...(frozenProps.current ?? settlementButtonProps)}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@thesahindia
Copy link
Member

@bernhardoj's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 13, 2024

Current assignee @Julesssss is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@thesahindia
Copy link
Member

thesahindia commented Dec 13, 2024

@mkzie2, we prefer not to use setTimeout unless it is absolutely necessary.

Copy link

melvin-bot bot commented Dec 17, 2024

@Julesssss, @OfstadC, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 17, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Dec 17, 2024

I see we're planning to revert this feature here, we should hold on this.

@Julesssss
Copy link
Contributor

As mentioned by @mkzie2, this is held.

@Julesssss Julesssss added Weekly KSv2 and removed Daily KSv2 labels Dec 17, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
Copy link

melvin-bot bot commented Dec 25, 2024

@Julesssss @OfstadC @thesahindia 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!

@Julesssss
Copy link
Contributor

Currently held

@melvin-bot melvin-bot bot added the Overdue label Jan 2, 2025
@Julesssss Julesssss removed the Overdue label Jan 3, 2025
@melvin-bot melvin-bot bot added the Overdue label Jan 3, 2025
@Julesssss
Copy link
Contributor

Still held

@melvin-bot melvin-bot bot removed the Overdue label Jan 3, 2025
Copy link

melvin-bot bot commented Jan 8, 2025

@Julesssss @OfstadC @thesahindia 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!

@melvin-bot melvin-bot bot added the Overdue label Jan 13, 2025
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 14, 2025
@Julesssss
Copy link
Contributor

No change on the status of the blocker.

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2025
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@melvin-bot melvin-bot bot added the Overdue label Jan 23, 2025
@Julesssss
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Jan 27, 2025
@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2025
@Julesssss
Copy link
Contributor

Awaiting further tests, we can hopefully close this soon

@melvin-bot melvin-bot bot removed the Overdue label Feb 5, 2025
@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@melvin-bot melvin-bot bot added the Overdue label Feb 14, 2025
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. Engineering 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 Overdue Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

7 participants