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-03-11] [HOLD for #36401] [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page #36439

Closed
2 of 6 tasks
kavimuru opened this issue Feb 13, 2024 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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 Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Feb 13, 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: v1.4.41-2
Reproducible in staging?: y
Reproducible in production?: n (new feature)
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. Open workspace settings page
  2. Click on 'Reimbursements'
  3. Click on 'Rate'
  4. Click on 'Rate' again
  5. Modify the rate > press 'Enter' key

Expected Result:

Amount change should be saved

Actual Result:

Page refreshes

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

Add any screenshot/video evidence

Bug6378609_1707856570560.Screen_Recording_2024-02-13_at_11.34.36_at_night.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01255e944bed02c24a
  • Upwork Job ID: 1757576298278928384
  • Last Price Increase: 2024-02-14
@kavimuru kavimuru added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 13, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 13, 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.

Copy link

melvin-bot bot commented Feb 13, 2024

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Feb 13, 2024

@shubham1206agra
Is it yours?)

Similar to #36363

@ghost
Copy link

ghost commented Feb 13, 2024

Proposal

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

Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page

What is the root cause of that problem?

The main root cause of the problem is that Form is getting submitted automatically when we hit Enter key on the keyboard.

<FormProvider
formID={ONYXKEYS.FORMS.WORKSPACE_RATE_AND_UNIT_FORM}
submitButtonText={translate('common.save')}
validate={validate}
onSubmit={submit}
enabledWhenOffline
style={[styles.flexGrow1]}
shouldHideFixErrorsAlert
submitFlexEnabled={false}
submitButtonStyles={[styles.mh5, styles.mt0]}
>
<InputWrapperWithRef
InputComponent={AmountForm}
inputID={INPUT_IDS.RATE}
currency={props.policy?.outputCurrency ?? CONST.CURRENCY.USD}
extraDecimals={1}
defaultValue={(
(typeof props.workspaceRateAndUnit?.rate === 'string' ? parseFloat(props.workspaceRateAndUnit.rate) : defaultValue) / CONST.POLICY.CUSTOM_UNIT_RATE_BASE_OFFSET
).toFixed(3)}
/>
</FormProvider>

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

The main change that will stop this issue is, we need to stop the Form from getting submitted, when we hit Enter keyboard, by adding some kind off e.preventDefault(), which is basically the default behaviour of the form, which will not only just stop submitting the form, but would also stop the page from reloading again and again on hitting Enter key.

What alternative solutions did you explore? (Optional)

N/A

@deetergp deetergp added the External Added to denote the issue can be worked on by a contributor label Feb 14, 2024
@melvin-bot melvin-bot bot changed the title Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

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

melvin-bot bot commented Feb 14, 2024

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

@deetergp
Copy link
Contributor

I don't think this is a blocker. I have confirmed that the bug exists in main and that the PR that @shubham1206agra raised for #36363 fixes this one too.

I was going to say that I'd expect hitting Enter would function the same clicking the Save button, but isn't how production works either.

@shubham1206agra
Copy link
Contributor

Oh I am working on this on separate PR. This is from another PR I raised earlier.

@cubuspl42
Copy link
Contributor

I understand that PR #36401 fixes this issue, right?

@deetergp deetergp added Daily KSv2 and removed Hourly KSv2 labels Feb 14, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 16, 2024
@Christinadobrzyn
Copy link
Contributor

@deetergp or @Ollyws could you confirm this for us? #36439 (comment)

@Ollyws
Copy link
Contributor

Ollyws commented Feb 19, 2024

Let's hold this one for #36401

@melvin-bot melvin-bot bot removed the Overdue label Feb 19, 2024
@cubuspl42
Copy link
Contributor

cubuspl42 commented Feb 19, 2024

This issue is now being handled in the regression path, and PR #36401 has been created to solve it. I'm not sure if we call such cases "holding".

Anyway, I'll make sure to make that PR ready for merging ASAP.

@shubham1206agra
Copy link
Contributor

Clarification here: The expected behaviour should be that the page should not refresh. We do not submit form on pressing Enter now on this specific page.

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 labels Feb 20, 2024
@Christinadobrzyn Christinadobrzyn changed the title [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page [HOLD for #36401] [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page Feb 20, 2024
@cubuspl42
Copy link
Contributor

Unless there's any objection, we'll assume the expected behavior @shubham1206agra mentioned.

@getusha
Copy link
Contributor

getusha commented Feb 23, 2024

Clarification here: The expected behaviour should be that the page should not refresh. We do not submit form on pressing Enter now on this specific page.

Is there any way to allow submitting the form on enter yet preventing the refresh?

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Feb 23, 2024

To prevent refresh, I already have a PR in place.

For submitting the form on Enter, I need to change so many components to achieve the same, so it might be a feature request for me. (This is context to this component only).

@getusha
Copy link
Contributor

getusha commented Feb 23, 2024

For submitting the form on Enter, I need to change so many components to achieve the same, so it might be a feature request for me. (This is context to this component only).

I feel like this should be handled here? or as a follow up? @shubham1206agra

@shubham1206agra
Copy link
Contributor

Let me see if there's a simple fix to this. If there is, I will add it in the same PR.

@getusha
Copy link
Contributor

getusha commented Feb 23, 2024

thanks @shubham1206agra, and the expected result is Amount change should be saved 😄

@shubham1206agra
Copy link
Contributor

@getusha Please check now. This is now same as Expected behavior.

@melvin-bot melvin-bot bot added the Overdue label Feb 28, 2024
@deetergp
Copy link
Contributor

Where are we at with this one?

@melvin-bot melvin-bot bot removed the Overdue label Feb 28, 2024
@cubuspl42
Copy link
Contributor

@deetergp

Good question 🤔

PR #36401 is still open, but it's both C+ and internally approved. Not merged yet, though. There was some post-approval discussion between @shubham1206agra and @getusha.

@deetergp
Copy link
Contributor

deetergp commented Mar 1, 2024

Nice! Looks like it got merged yesterday.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 4, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for #36401] [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page [HOLD for payment 2024-03-11] [HOLD for #36401] [$500] Reimburse - Pressing 'Enter' key on 'Rate' page refreshes the page Mar 4, 2024
Copy link

melvin-bot bot commented Mar 4, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.46-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-03-11. 🎊

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

  • @Ollyws requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 4, 2024

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:

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

@cubuspl42
Copy link
Contributor

  • No payment due for @Ollyws
  • BugZero checklist is redundant, as this was handled as a regression

@deetergp
Copy link
Contributor

deetergp commented Mar 6, 2024

I think that means we can close this one out then, right?

@Christinadobrzyn
Copy link
Contributor

Yep! closing!

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. 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 Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants