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 2023-12-07] [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page #31830

Closed
6 tasks done
kbecciv opened this issue Nov 24, 2023 · 22 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Nov 24, 2023

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: 1.4.3.0
Reproducible in staging?: y
Reproducible in production?: unable check production flow
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. Navigate to staging.new.expensify.com.
  2. Go to Settings > Workspaces > any workspace.
  3. Go to Bank account.
  4. Click Connect online with Plaid.
  5. Proceed with Chase login.
  6. Back in ND bank account selection page, select Plaid Saving 1111.
  7. Check the ToS checkbox.
  8. Click Save & continue.

Expected Result:

User is able to proceed to the next page.

Actual Result:

Validation error "You must accept the Terms of Service to continue" shows up even though the checkbox is already checked.

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

Bug6289520_1700831559435.bandicam_2023-11-24_11-02-22-373.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0137f7d0a93c64668a
  • Upwork Job ID: 1728087336492617728
  • Last Price Increase: 2023-11-24
  • Automatic offers:
    • 0xmiroslav | Reviewer | 28033147
    • mkhutornyi | Contributor | 28033148
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Nov 24, 2023
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 Nov 24, 2023

Triggered auto assignment to @Julesssss (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

Copy link

melvin-bot bot commented Nov 24, 2023

📣 @github-actions[bot]! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@Julesssss Julesssss added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Nov 24, 2023
@Julesssss
Copy link
Contributor

Reproducible in production?: unable check production flow

Removing the blocker label, as we're unable to confirm this issue in prod. We'll immediately open up for proposals.

@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Nov 24, 2023
@melvin-bot melvin-bot bot changed the title Bank account - Error still shows up after checking the ToS checkbox in account selection page [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page Nov 24, 2023
Copy link

melvin-bot bot commented Nov 24, 2023

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

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

melvin-bot bot commented Nov 24, 2023

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

@shubham1206agra
Copy link
Contributor

@Julesssss This is a deploy blocker coming from #31795. Reverting here won't help as it will trigger another deploy blocker which fixed this issue.

@mkhutornyi Are you here to quickly fix this?

@shubham1206agra
Copy link
Contributor

I am just going to put the corrected file here.

import PropTypes from 'prop-types';
import React, {useState} from 'react';
import {View} from 'react-native';
import _ from 'underscore';
import useThemeStyles from '@styles/useThemeStyles';
import variables from '@styles/variables';
import Checkbox from './Checkbox';
import FormHelpMessage from './FormHelpMessage';
import PressableWithFeedback from './Pressable/PressableWithFeedback';
import Text from './Text';
import refPropTypes from './refPropTypes';

/**
 * Returns an error if the required props are not provided
 * @param {Object} props
 * @returns {Error|null}
 */
const requiredPropsCheck = (props) => {
    if (!props.label && !props.LabelComponent) {
        return new Error('One of "label" or "LabelComponent" must be provided');
    }

    if (props.label && typeof props.label !== 'string') {
        return new Error('Prop "label" must be a string');
    }

    if (props.LabelComponent && typeof props.LabelComponent !== 'function') {
        return new Error('Prop "LabelComponent" must be a function');
    }
};

const propTypes = {
    /** Whether the checkbox is checked */
    isChecked: PropTypes.bool,

    /** Called when the checkbox or label is pressed */
    onInputChange: PropTypes.func.isRequired,

    /** Container styles */
    style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),

    /** Text that appears next to check box */
    label: requiredPropsCheck,

    /** Component to display for label */
    LabelComponent: requiredPropsCheck,

    /** Error text to display */
    errorText: PropTypes.string,

    /** Value for checkbox. This prop is intended to be set by Form.js only */
    value: PropTypes.bool,

    /** The default value for the checkbox */
    defaultValue: PropTypes.bool,

    /** Ref for the checkbox */
    forwardedRef: refPropTypes,

    /** The ID used to uniquely identify the input in a Form */
    /* eslint-disable-next-line react/no-unused-prop-types */
    inputID: PropTypes.string,

    /** Saves a draft of the input value when used in a form */
    /* eslint-disable-next-line react/no-unused-prop-types */
    shouldSaveDraft: PropTypes.bool,

    /** An accessibility label for the checkbox */
    accessibilityLabel: PropTypes.string,
};

const defaultProps = {
    inputID: undefined,
    style: [],
    label: undefined,
    LabelComponent: undefined,
    errorText: '',
    shouldSaveDraft: false,
    isChecked: false,
    value: false,
    defaultValue: false,
    forwardedRef: () => {},
    accessibilityLabel: undefined,
};

function CheckboxWithLabel(props) {
    const styles = useThemeStyles();
    // We need to pick the first value that is strictly a boolean
    // https://github.com/Expensify/App/issues/16885#issuecomment-1520846065
    const [isChecked, setIsChecked] = useState(() => _.find([props.value, props.defaultValue, props.isChecked], (value) => _.isBoolean(value)));

    const toggleCheckbox = () => {
        const newState = !isChecked;
        props.onInputChange(newState);
        setIsChecked(newState);
    };

    const LabelComponent = props.LabelComponent;

    return (
        <View style={props.style}>
            <View style={[styles.flexRow, styles.alignItemsCenter, styles.breakWord]}>
                <Checkbox
                    isChecked={isChecked}
                    onPress={toggleCheckbox}
                    label={props.label}
                    style={[styles.checkboxWithLabelCheckboxStyle]}
                    hasError={Boolean(props.errorText)}
                    ref={props.forwardedRef}
                    accessibilityLabel={props.accessibilityLabel || props.label}
                />
                <PressableWithFeedback
                    tabIndex={-1}
                    accessible={false}
                    onPress={toggleCheckbox}
                    pressDimmingValue={variables.checkboxLabelActiveOpacity}
                    // We want to disable hover dimming
                    hoverDimmingValue={variables.checkboxLabelHoverOpacity}
                    style={[styles.flexRow, styles.alignItemsCenter, styles.noSelect, styles.w100]}
                    wrapperStyle={[styles.ml3, styles.pr2, styles.w100, styles.flexWrap, styles.flexShrink1]}
                >
                    {props.label && <Text style={[styles.ml1]}>{props.label}</Text>}
                    {LabelComponent && <LabelComponent />}
                </PressableWithFeedback>
            </View>
            <FormHelpMessage message={props.errorText} />
        </View>
    );
}

CheckboxWithLabel.propTypes = propTypes;
CheckboxWithLabel.defaultProps = defaultProps;
CheckboxWithLabel.displayName = 'CheckboxWithLabel';

const CheckboxWithLabelWithRef = React.forwardRef((props, ref) => (
    <CheckboxWithLabel
        // eslint-disable-next-line react/jsx-props-no-spreading
        {...props}
        forwardedRef={ref}
    />
));

CheckboxWithLabelWithRef.displayName = 'CheckboxWithLabelWithRef';

export default CheckboxWithLabelWithRef;

@mkhutornyi
Copy link
Contributor

checking

@tienifr
Copy link
Contributor

tienifr commented Nov 24, 2023

Proposal

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

Validation error "You must accept the Terms of Service to continue" shows up even though the checkbox is already checked.

What is the root cause of that problem?

The value here is always false, causing the form to always set false to the value in the form as per this logic

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

Update this to undefined as default value

value: undefined,

What alternative solutions did you explore? (Optional)

NA

@mkhutornyi
Copy link
Contributor

raising PR in a few min

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 24, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Nov 29, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 29, 2023
Copy link

melvin-bot bot commented Nov 29, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @0xmiroslav requires payment

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-12-06] [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page [HOLD for payment 2023-12-07] [HOLD for payment 2023-12-06] [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @0xmiroslav requires payment

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

melvin-bot bot commented Dec 11, 2023

@Julesssss, @0xmiroslav Huh... This is 4 days overdue. Who can take care of this?

@Julesssss Julesssss changed the title [HOLD for payment 2023-12-07] [HOLD for payment 2023-12-06] [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page [HOLD for payment 2023-12-07] [$500] Bank account - Error still shows up after checking the ToS checkbox in account selection page Dec 11, 2023
@Julesssss Julesssss added the Bug Something is broken. Auto assigns a BugZero manager. label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@Julesssss
Copy link
Contributor

Heya @greg-schroeder, can you just do a review payment for @0xmiroslav please

@mkhutornyi
Copy link
Contributor

@Julesssss I don't need any payment here but just assign me as I worked for the issue.

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

melvin-bot bot commented Dec 11, 2023

📣 @0xmiroslav 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Dec 11, 2023

📣 @mkhutornyi 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@greg-schroeder
Copy link
Contributor

Okay I sent you an offer Miki!

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants