You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-05-14] [$250] Web - Contact methods - Validation opens when the link contains invalid contact method #58730
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.1.15-3 Reproducible in staging?: Yes Reproducible in production?: Yes 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: N/A Issue reported by: Applause Internal Team
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render the component with the mock route and verify that it's show not found page
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.
However, somehow after we visit the page with any contact method, the data is created. And it's because of this useEffect that reset the code sent state without checking first whether the contact method exist or not. It only checks whether it's already validated or not, which is false for non-existent contact.
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- The prevPendingDeletedLogin is a ref, so no need to add it to dependencies.
},[contactMethod,loginData?.validatedDate]);
What changes do you think we should make in order to solve the problem?
We need to early return if the contact method isn't found too.
if (!loginData || loginData?.validatedDate || prevPendingDeletedLogin) {
return;
}
optional, to cover a case where there is invalid login data on the onyx, we can improve the not found check by checking whether the login data has partnerUserID or not
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render contact method details page with an invalid contact method as the route params and verify it shows the not found page.
Hey @vincdargento vincdargento, can this issue only be reproduced when accessing via a direct link? If so, how would users typically obtain that link in the first place?
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Pujan92@strepanier03@Pujan92 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Mar 19, 2025
Triggered auto assignment to @stephanieelliott (
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.nkdengineer commentedon Mar 19, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-19 15:32:45 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
RHP opens validation page for "invalidContactMethodName".
What is the root cause of that problem?
We get
contactMethodfrom the routeApp/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx
Lines 74 to 75 in 994c3cd
And not has a condition to check the
contactMethodis validWhat changes do you think we should make in order to solve the problem?
We can check if the
contactMethodnot includes inLoginListsor inpersonalDetailsListwe will show the<NotFoundPage />Example we can use the function
getPersonalDetailByEmailto checkWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render the component with the mock route and verify that it's show not found page
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 commentedon Mar 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The invalid contact method still opens and show a validate code action input.
What is the root cause of that problem?
We already show a not found page if the contact method doesn't exist in LOGIN_LIST onyx data.
App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx
Lines 195 to 206 in 994c3cd
However, somehow after we visit the page with any contact method, the data is created. And it's because of this useEffect that reset the code sent state without checking first whether the contact method exist or not. It only checks whether it's already validated or not, which is false for non-existent contact.
App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx
Lines 170 to 177 in 994c3cd
What changes do you think we should make in order to solve the problem?
We need to early return if the contact method isn't found too.
optional, to cover a case where there is invalid login data on the onyx, we can improve the not found check by checking whether the login data has partnerUserID or not
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render contact method details page with an invalid contact method as the route params and verify it shows the not found page.
stephanieelliott commentedon Mar 21, 2025
Hey @vincdargento vincdargento, can this issue only be reproduced when accessing via a direct link? If so, how would users typically obtain that link in the first place?
melvin-bot commentedon Mar 24, 2025
@stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
stephanieelliott commentedon Mar 25, 2025
Closing this, I think it's not something regular users wil run into
bernhardoj commentedon Mar 25, 2025
@stephanieelliott it allows the user to input any email, which means a user can use another user's email to request a magic code.
Pujan92 commentedon Mar 26, 2025
@stephanieelliott I think we should avoid user accessing this route for invalid contact method.
stephanieelliott commentedon Apr 2, 2025
Discussing in Slack: https://expensify.slack.com/archives/C01GTK53T8Q/p1743614196216279
47 remaining items
melvin-bot commentedon May 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-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 2025-05-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 7, 2025
@Pujan92 @strepanier03 @Pujan92 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon May 14, 2025
Payment Summary
Upwork Job
BugZero Checklist (@strepanier03)
Pujan92 commentedon May 14, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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: https://github.com/Expensify/App/pull/56487/files#r2088535550
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Do we agree 👍 or 👎
strepanier03 commentedon May 15, 2025
Payment summary
strepanier03 commentedon May 15, 2025
Payment summary above @Pujan92 and @bernhardoj, you're all set to request. Closing this out and thank you both!
bernhardoj commentedon May 15, 2025
Requested in ND.
garrettmknight commentedon May 20, 2025
$250 approved for @Pujan92
JmillsExpensify commentedon May 22, 2025
$250 approved for @bernhardoj