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-11-02] [$500] Dev - Home address - AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined) #28334

Closed
2 of 6 tasks
kbecciv opened this issue Sep 27, 2023 · 41 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 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 27, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the profile popup via LHN
  2. Click the profile image icon to open up profile settings
  3. Click 'Personal details'
  4. Click 'Home address'

Expected Result:

The testID property for the page should be assigned a valid value.

Actual Result:

The testID property is undefined. As a result, end-to-end testing is compromised, due to many pages missing testIDs.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: Dev 1.3.74-0
Reproducible in staging?: n
Reproducible in production?: n
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
Notes/Photos/Videos: Any additional supporting documentation

bug-1.mov
bug-1-ios-web.mov

Expensify/Expensify Issue URL:
Issue reported by: @Samueljh1
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695735346255799

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010af2a5f37c5f7f2f
  • Upwork Job ID: 1707080289779253248
  • Last Price Increase: 2023-09-27
  • Automatic offers:
    • samueljh1 | Reporter | 27506510
Issue OwnerCurrent Issue Owner: @garrettmknight
@kbecciv kbecciv added the External Added to denote the issue can be worked on by a contributor label Sep 27, 2023
@melvin-bot melvin-bot bot changed the title Dev - Home address - AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined) [$500] Dev - Home address - AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined) Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

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

melvin-bot bot commented Sep 27, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 27, 2023
@ikevin127
Copy link
Contributor

ikevin127 commented Sep 27, 2023

Proposal - Updated

@roryabraham:

As stated above, I want to see a proposal for this issue which fixes it by:

1. Removing the custom lint rule from eslint-config-expensify that prevents setting `displayName` on class components

2. Adding a new lint rule that requires all React components to have their `displayName` property set.

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

  1. Removing the custom lint rule from eslint-config-expensify that prevents setting displayName on class components.
  2. Adding a new lint rule that requires all React components to have their displayName property set.

What is the root cause of that problem?

The testID property is undefined for multiple pages and due to it being a required prop we get the reported console errors whenever displayName is not set for a component.

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

As mentioned by the quote at the start of the updated proposal we need the following changes:

  1. Removing the custom lint rule from eslint-config-expensify that prevents setting displayName on class components:
module.exports = {
    rules: {
        'rulesdir/no-negated-variables': 'error',
        'rulesdir/no-api-in-views': 'error',
        'rulesdir/prefer-actions-set-data': 'error',
        'rulesdir/prefer-onyx-connect-in-libs': 'error',
        'rulesdir/no-thenable-actions-in-views': 'error',
        'rulesdir/prefer-early-return': 'error',
        'rulesdir/no-inline-named-export': 'error',
        'rulesdir/prefer-underscore-method': 'error',
        'rulesdir/no-useless-compose': 'error',
        'rulesdir/prefer-import-module-contents': 'error',
        'rulesdir/no-multiple-api-calls': 'error',
        'rulesdir/no-multiple-onyx-in-file': 'error',
        'rulesdir/no-call-actions-from-actions': 'error',
        'rulesdir/no-api-side-effects-method': 'error',
-       'rulesdir/display-name-property': 'error',
        'rulesdir/prefer-localization': 'error',
        'rulesdir/onyx-props-must-have-default': 'error',
        'no-restricted-imports': ['error', {
            paths: [{
                name: 'react-native',
                importNames: ['Button', 'Text', 'TextInput', 'Picker'],
                message: 'Please use an Expensify component from src/components/ instead.',
            }, {
                name: 'react-native',
                importNames: ['SafeAreaView'],
                message: 'Please use SafeAreaView from react-native-safe-area-context',
            }],
        }],
    },
};
  1. Adding a new lint rule that requires all React components to have their displayName property set:
        ...
        {
            files: ['*.js', '*.jsx'],
            settings: {
                'import/resolver': {
                    node: {
                        extensions: ['.js', '.website.js', '.desktop.js', '.native.js', '.ios.js', '.android.js', '.config.js', '.ts', '.tsx'],
                    },
                },
            },
            rules: {
                'import/extensions': [
                    'error',
                    'ignorePackages',
                    {
                        js: 'never',
                        jsx: 'never',
                        ts: 'never',
                        tsx: 'never',
                    },
                ],
                'no-restricted-imports': [
                    'error',
                    {
                        paths: restrictedImportPaths,
                        patterns: restrictedImportPatterns,
                    },
                ],
                curly: 'error',
+                "react/display-name": [
+                    "error",
+                    {
+                        ignoreTranspilerName: false
+                    }
+                ],
+            },
+        },
        ...

The video below demonstrates:

  • removal of the display name rule from eslint-config-expensify
  • addition of the react/display-name rule to the .eslintrc.js for .js / .jsx components
  • the testID error still occurs on PersonalDetailsInitialPage component when the display name is not set
  • the npm run lint linter results requiring all React components to have their displayName property set

What alternative solutions did you explore? (Optional)

N/A

Videos

web.mp4

@ZhenjaHorbach
Copy link
Contributor

I'm not sure if this problem is still relevant

This PR #28089 should have fixed errors like this

@HardikChoudhary24
Copy link
Contributor

HardikChoudhary24 commented Sep 27, 2023

Proposal

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

  • AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined)

What is the root cause of that problem?

  • The root cause of this issue is the absence of AddressPage.displayName="AddressPage" for the AddressPage and similarly for other pages.

<ScreenWrapper
includeSafeAreaPaddingBottom={false}
testID={AddressPage.displayName}
>

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

  • To address this problem, we can resolve it by simply adding AddressPage.displayName="AddressPage" for Address Page Component and similarly for each components missing the displayName.
    This will solve the issue perfectly.

What alternative solutions did you explore? (Optional)
N/A

@ZhenjaHorbach
Copy link
Contributor

Proposal

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

  • AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined)

What is the root cause of that problem?

  • The root cause of this issue is the absence of testID ={AddressPage.displayName} where AddressPage.displayName="AddressPage" for the AddressPage and similarly for other pages.

<ScreenWrapper includeSafeAreaPaddingBottom={false}>

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

  • To address this problem, we can resolve it by simply adding testID ={AddressPage.displayName} and setting AddressPage.displayName="AddressPage" for each components missing the testID prop.
    This will solve the issue perfectly.

What alternative solutions did you explore? (Optional) N/A

Check main branch)

@HardikChoudhary24
Copy link
Contributor

Proposal

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

  • AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined)

What is the root cause of that problem?

  • The root cause of this issue is the absence of testID ={AddressPage.displayName} where AddressPage.displayName="AddressPage" for the AddressPage and similarly for other pages.

<ScreenWrapper includeSafeAreaPaddingBottom={false}>

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

  • To address this problem, we can resolve it by simply adding testID ={AddressPage.displayName} and setting AddressPage.displayName="AddressPage" for each components missing the testID prop.
    This will solve the issue perfectly.

What alternative solutions did you explore? (Optional) N/A

Check main branch)

Yes, I have Updated my proposal.

@Samueljh1
Copy link
Contributor

Proposal

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

The testID property for the affected pages (e.g., AddressPage) should be assigned a valid value, but it is instead undefined for many pages.

What is the root cause of that problem?

Some pages have missing definitions for the displayName prop, which is commonly used to set the testID prop.

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

Add a definition for XXXPage.displayName for all pages using a ScreenWrapper, to ensure testID is not undefined.

What alternative solutions did you explore? (Optional)

@roryabraham
Copy link
Contributor

Sorry, I caused this bug. I think to fix it we should remove the lint rule that prevents setting displayName on class components, and instead enforce that all components have a displayName set.

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

@sobitneupane Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Oct 3, 2023
@roryabraham roryabraham self-assigned this Oct 4, 2023
@roryabraham
Copy link
Contributor

Assigning myself since I caused all these console errors in #27978

@melvin-bot melvin-bot bot removed the Overdue label Oct 4, 2023
@roryabraham
Copy link
Contributor

As stated above, I want to see a proposal for this issue which fixes it by:

  1. Removing the custom lint rule from eslint-config-expensify that prevents setting displayName on class components
  2. Adding a new lint rule that requires all React components to have their displayName property set.

@sobitneupane
Copy link
Contributor

We haven't received any proposal that meets the expectation.

@ikevin127
Copy link
Contributor

Updated my proposal.
Of course it will require me to add the displayName for all those 77 components that are missing it.

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

melvin-bot bot commented Oct 4, 2023

📣 @sobitneupane Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @ikevin127 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @Samueljh1 We're missing your Upwork ID to automatically send you an offer for the Reporter role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@roryabraham
Copy link
Contributor

@ikevin127 the video looks good so I assigned you, but I'm a bit confused about one thing:

  • from the docs, ignoreTranspilerName defaults to false and the setting it to true seems to be what makes the displayName property required. Are the docs wrong or did you mean to include ignoreTranspilerName=true in your proposal? Or am I missing something?
  • Please also create a follow-up PR in eslint-config-expensify to remove the unused custom rule once it's no longer used in this codebase.

Thanks!

@roryabraham
Copy link
Contributor

Or if ignoreTranspilerName should indeed be false, I think that should be the default according to the docs, so we don't need to specify it.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 26, 2023
@melvin-bot melvin-bot bot changed the title [$500] Dev - Home address - AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined) [HOLD for payment 2023-11-02] [$500] Dev - Home address - AddressPage (and many more) – Missing displayName prop leads to console error (testID undefined) Oct 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 2, 2023
@roryabraham roryabraham added the Bug Something is broken. Auto assigns a BugZero manager. label Nov 3, 2023
Copy link

melvin-bot bot commented Nov 3, 2023

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

Copy link

melvin-bot bot commented Nov 3, 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 Nov 3, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Contributor role ($500)

Copy link

melvin-bot bot commented Nov 3, 2023

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

Offer link
Upwork job

@roryabraham
Copy link
Contributor

@garrettmknight we were missing a BZ assignee here, my fault! let's issue payments for this issue. Thanks!

@situchan
Copy link
Contributor

situchan commented Nov 3, 2023

There was regression fixed in #30397

@garrettmknight garrettmknight self-assigned this Nov 3, 2023
@garrettmknight
Copy link
Contributor

I can help out

@garrettmknight
Copy link
Contributor

@ikevin127 can you apply to this job posting in Upwork so I can pay you out?

@garrettmknight
Copy link
Contributor

@Samueljh1 can you accept this offer so I can pay you out?

@garrettmknight
Copy link
Contributor

garrettmknight commented Nov 3, 2023

Summary of payments:

@JmillsExpensify
Copy link

$250 payment approved for @mananjadhav based on comment above.

@Samueljh1
Copy link
Contributor

@Samueljh1 can you accept this offer so I can pay you out?

Done, thanks

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@garrettmknight
Copy link
Contributor

Everyone's paid - 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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests