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

[$500] Web - Errors appear in the JS console when requesting money or assigning a task #32605

Closed
1 of 6 tasks
lanitochka17 opened this issue Dec 7, 2023 · 69 comments
Closed
1 of 6 tasks
Assignees
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 7, 2023

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: 1.4.9-0
Reproducible in staging?: Y
Reproducible in production?: Y
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:

Issue found when executing PR #29157

Action Performed:

  1. Navigate to staging.new.expensify.com and log in
  2. Create a money request > check JS console
  3. Create an assigned task > check JS console

Expected Result:

No errors appear in JS console

Actual Result:

Errors appear in JS console when requesting money or assigning a task

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014f402f86bef1bf3e
  • Upwork Job ID: 1732568096774332416
  • Last Price Increase: 2024-03-16
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 7, 2023
@melvin-bot melvin-bot bot changed the title Web - Errors appear in the JS console when requesting money or assigning a task [$500] Web - Errors appear in the JS console when requesting money or assigning a task Dec 7, 2023
Copy link

melvin-bot bot commented Dec 7, 2023

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

Copy link

melvin-bot bot commented Dec 7, 2023

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

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

melvin-bot bot commented Dec 7, 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

Copy link

melvin-bot bot commented Dec 7, 2023

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

@situchan
Copy link
Contributor

situchan commented Dec 7, 2023

@lanitochka17 can you please share console log?

@OleksandrYakuba
Copy link

Hello @lanitochka17
Sorry to hear that JS console errors appear.
May I see the console log?

Copy link

melvin-bot bot commented Dec 7, 2023

📣 @OleksandrYakuba! 📣
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>

@OleksandrYakuba
Copy link

Contributor details
Your Expensify account email: frank18gumbslb4@outlook.com
Upwork Profile Link: https://upwork.com/freelancers/~01f72d6e1a5222250a

Copy link

melvin-bot bot commented Dec 7, 2023

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

@OleksandrYakuba
Copy link

Contributor details
Your Expensify account email: frank18gumbslb4@outlook.com
Upwork Profile Link: https://upwork.com/freelancers/~01f72d6e1a5222250a

@OleksandrYakuba
Copy link

Make sure?

@BhuvaneshPatil
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

  1. For new task page
    In dev I got this error (not sure if reporter is mentioning about the same)
Screenshot 2023-12-07 at 7 49 47 AM

titleWithTooltips={!shareDestination.shouldUseFullTitleToDisplay && shareDestination.displayNamesWithTooltips}

if !shareDestination.shouldUseFullTitleToDisplay resolves to be false, we are passing false as prop.

I couldn't repro the error on Money request

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

For new task page
change the line to -
titleWithTooltips={!shareDestination.shouldUseFullTitleToDisplay ? shareDestination.displayNamesWithTooltips : []},
hence we will be passing empty array, this respects the prop type.

What alternative solutions did you explore? (Optional)

@OleksandrYakuba
Copy link

@BhuvaneshPatil
I think your suggestion is correct.
Prop type of MenuItem is defined array[], so it is correct to pass empty array as titleWithTooltips.
I tested your suggestion with vanilla JS.

@OleksandrYakuba
Copy link

OleksandrYakuba commented Dec 7, 2023

Otherwise, prop type of MenuItem's titleWithTooltips can be defined as following.

current:
titleWithTooltips : []

change:

titleWithTooltips : PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.array
]),

@OleksandrYakuba
Copy link

waiting for response

@laurenreidexpensify
Copy link
Contributor

@situchan can you review? Thanks

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

@laurenreidexpensify I asked here but if no answer, I will go ahead with console error I measured

@lanitochka17
Copy link
Author

Sorry for delay

Bug6303814_1701907014279.JS_console_error_when_requesting_money_or_assign_task.mp4

logs.txt

@OleksandrYakuba
Copy link

This is CORS error.
To solve the problem, it is needs to add 'Access-Control-Allow-Origin: *' header to server response.

@OleksandrYakuba
Copy link

I recommend CORS package for it.

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Mar 4, 2024

I checked the git blame, and it takes back to more than a year back. It happened(in some cases) because of migration to PressableWithoutFeedback where the accessibility Roles were added.
Don't know how it went un-caught for this long.

@laurenreidexpensify
Copy link
Contributor

@BhuvaneshPatil can you link the PR pls thanks

@BhuvaneshPatil
Copy link
Contributor

@BhuvaneshPatil
Copy link
Contributor

@situchan I have added the PR that caused this issue

@melvin-bot melvin-bot bot added the Overdue label Mar 7, 2024
@situchan
Copy link
Contributor

situchan commented Mar 7, 2024

@BhuvaneshPatil I see this console error when open the app. Not only ReferralProgramCTA, BaseListItem

Screenshot 2024-03-04 at 8 30 50 PM

what do you think of this console error?

@melvin-bot melvin-bot bot removed the Overdue label Mar 7, 2024
@BhuvaneshPatil
Copy link
Contributor

That error is for Pay with Expensify button (first message in the image).
The reason is - #32605 (comment)

Copy link

melvin-bot bot commented Mar 9, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

@laurenreidexpensify, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@BhuvaneshPatil
Copy link
Contributor

^^ @situchan

Copy link

melvin-bot bot commented Mar 13, 2024

@laurenreidexpensify, @situchan Eep! 4 days overdue now. Issues have feelings too...

@situchan
Copy link
Contributor

Thanks. I will provide feedback soon

@melvin-bot melvin-bot bot removed the Overdue label Mar 13, 2024
@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@melvin-bot melvin-bot bot added the Overdue label Mar 15, 2024
@situchan
Copy link
Contributor

This is still reproducible

@melvin-bot melvin-bot bot removed the Overdue label Mar 15, 2024
Copy link

melvin-bot bot commented Mar 16, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 18, 2024
@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week)

@wildan-m
Copy link
Contributor

wildan-m commented Mar 20, 2024

Proposal

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

Web - Errors appear in the JS console when requesting money or assigning a task

What is the root cause of that problem?

In the Report Preview, we define the role of 'PressableWithoutFeedback' as a 'button' that wraps other buttons. This can cause issues with the HTML, especially when navigating with the keyboard or using assistive technology.

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

We can rearrange the internal buttons so they are not contained within the pressable component.

Here is a example of restructuring without altering the style. Restructure this code as follows:

        <OfflineWithFeedback
            pendingAction={iouReport?.pendingFields?.preview}
            shouldDisableOpacity={!!(action.pendingAction ?? action.isOptimisticAction)}
            needsOffscreenAlphaCompositing
        >
            <View style={[styles.chatItemMessage, containerStyles]}>
                <View style={[styles.flexRow, styles.justifyContentBetween, styles.reportPreviewBox]}>
                    <View style={[styles.reportPreviewBox, isHovered || isScanning || isWhisper ? styles.reportPreviewBoxHoverBorder : undefined]}>

                        <PressableWithoutFeedback
                            onPress={() => {
                                Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(iouReportID));
                            }}
                            onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
                            onPressOut={() => ControlSelection.unblock()}
                            onLongPress={(event) => showContextMenuForReport(event, contextMenuAnchor, chatReportID, action, checkIfContextMenuActive)}
                            shouldUseHapticsOnLongPress
                            role="button"
                            accessibilityLabel={translate('iou.viewDetails')}
                        >
                            {hasReceipts && (
                                <ReportActionItemImages
                                    images={lastThreeReceipts}
                                    total={transactionsWithReceipts.length}
                                    size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
                                />
                            )}
                            <View style={[styles.expenseAndReportPreviewBoxBody, hasReceipts ? styles.mtn1 : {}]}>
                                <View style={styles.expenseAndReportPreviewTextButtonContainer}>
                                    <View style={styles.expenseAndReportPreviewTextContainer}>
                                        <View style={styles.flexRow}>
                                            <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
                                                <Text style={[styles.textLabelSupporting, styles.lh16]}>{getPreviewMessage()}</Text>
                                            </View>
                                            {shouldShowRBR && (
                                                <Icon
                                                    src={Expensicons.DotIndicator}
                                                    fill={theme.danger}
                                                />
                                            )}

                                            {!shouldShowRBR && shouldPromptUserToAddBankAccount && (
                                                <Icon
                                                    src={Expensicons.DotIndicator}
                                                    fill={theme.success}
                                                />
                                            )}
                                        </View>
                                        <View style={styles.reportPreviewAmountSubtitleContainer}>
                                            <View style={styles.flexRow}>
                                                <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
                                                    <Text style={styles.textHeadlineH1}>{getDisplayAmount()}</Text>
                                                    {ReportUtils.isSettled(iouReportID) && (
                                                        <View style={styles.defaultCheckmarkWrapper}>
                                                            <Icon
                                                                src={Expensicons.Checkmark}
                                                                fill={theme.iconSuccessFill}
                                                            />
                                                        </View>
                                                    )}
                                                </View>
                                            </View>
                                            {shouldShowSubtitle && (
                                                <View style={styles.flexRow}>
                                                    <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
                                                        <Text style={[styles.textLabelSupporting, styles.textNormal, styles.lh20]}>{previewSubtitle || moneyRequestComment}</Text>
                                                    </View>
                                                </View>
                                            )}
                                        </View>
                                    </View>
                                </View>
                            </View>
                        </PressableWithoutFeedback>
                        {(shouldShowSettlementButton || shouldShowSubmitButton) && <View style={[styles.ph4, styles.pb4]}>
                            {shouldShowSettlementButton && (
                                <SettlementButton
                                    currency={iouReport?.currency}
                                    policyID={policyID}
                                    chatReportID={chatReportID}
                                    iouReport={iouReport}
                                    onPress={(paymentType?: PaymentMethodType) => chatReport && iouReport && paymentType && IOU.payMoneyRequest(paymentType, chatReport, iouReport)}
                                    enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
                                    addBankAccountRoute={bankAccountRoute}
                                    shouldHidePaymentOptions={!shouldShowPayButton}
                                    shouldShowApproveButton={shouldShowApproveButton}
                                    kycWallAnchorAlignment={{
                                        horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
                                        vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
                                    }}
                                    paymentMethodDropdownAnchorAlignment={{
                                        horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
                                        vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
                                    }}
                                    isDisabled={!canAllowSettlement}
                                />
                            )}
                            {shouldShowSubmitButton && (
                                <Button
                                    medium
                                    success={isWaitingForSubmissionFromCurrentUser}
                                    text={translate('common.submit')}
                                    onPress={() => iouReport && IOU.submitReport(iouReport)}
                                />
                            )}
                        </View>
                        }
                    </View>
                </View>
            </View>
        </OfflineWithFeedback>

What alternative solutions did you explore? (Optional)

Completely remove role='button' from the pressable

@laurenreidexpensify
Copy link
Contributor

No longer reproducible

@wildan-m
Copy link
Contributor

@laurenreidexpensify @situchan Actually, the issue persists with the latest main in development, which is not shown in staging. It appears that some logging is intentionally suppressed in staging?

image

@BhuvaneshPatil
Copy link
Contributor

Reproducible for me as well, We need to have Pay with Expensify button in order to view the error

@situchan
Copy link
Contributor

There's more case:

Screenshot 2024-03-22 at 9 17 14 PM

@situchan
Copy link
Contributor

situchan commented Mar 22, 2024

Btw, I think we can keep this closed for now as only dev console error, not impacting production users.
We can reopen after wave is gone.

P.S. #35633 is more annoying console error on iOS but we closed it.

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

No branches or pull requests

9 participants