Repository navigation
[Due for payment 2025-02-19] [$250] iOS - Contact method - Nothing happens on tapping the main email & secondary contact in contact methods page #56355
Description
Activity
- addedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2
on Feb 4, 2025 Triggered auto assignment to @MitchExpensify (
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.- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Feb 5, 2025 Job added to Upwork: https://www.upwork.com/jobs/~021886927951828663823
- changed the title
[-]iOS - Contact method - Nothing happens on tapping the main email & secondary contact in contact methods page[/-][+][$250] iOS - Contact method - Nothing happens on tapping the main email & secondary contact in contact methods page[/+]on Feb 5, 2025 - addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Feb 5, 2025 Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)🚨 Edited by proposal-police: This proposal was edited at 2025-02-05 21:42:30 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Fails to enter the contact details page.
What is the root cause of that problem?
When entering the contact details page, the effect below resets the code to unsent state.
resetContactMethodValidateCodeSentState(contactMethod); It runs an Onyx merge command.
Line 323 in 27780d5
Onyx.merge(ONYXKEYS.LOGIN_LIST, { loginListisundefinedwhile a merge is pending. After the merge completes, the value becomes valid again.const [loginList, loginListResult] = useOnyx(ONYXKEYS.LOGIN_LIST); The effect below sees this change from undefined to valid as the contact method just getting verified, so it navigates the page back to the contact list.
App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx
Lines 158 to 160 in adc61ce
// Navigate to methods page on successful magic code verification // validatedDate property is responsible to decide the status of the magic code verification Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo)); What changes do you think we should make in order to solve the problem?
Only reset the code sent state if the contact method hasn’t been verified yet.
resetContactMethodValidateCodeSentState(contactMethod); useEffect(() => { if (loginData?.validatedDate) { return; } resetContactMethodValidateCodeSentState(contactMethod); }, [contactMethod, loginData?.validatedDate]);
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
To prevent the undefined value during the merge, pass
{allowStaleData: true}to useOnyx.const [loginList, loginListResult] = useOnyx(ONYXKEYS.LOGIN_LIST); const [loginList, loginListResult] = useOnyx(ONYXKEYS.LOGIN_LIST, {allowStaleData: true});
Proposal
Please re-state the problem that we are trying to solve in this issue.
- Nothing happens on tapping the main email & secondary contact method in contact methods page
What is the root cause of that problem?
-
We have implemented a logic to navigate back to the previous screen, which can be found here:
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo)); -
This navigation occurs when a specific condition is not met:
if (prevValidatedDate || !loginData?.validatedDate || !loginData) { -
In this bug, when tapping on the main email or secondary email, the app navigates to the
ContactMethodDetailsPagebut immediately navigates back. This happens becauseprevValidatedDateisundefinedat the time of navigation. The reason for this is thatloginData?.validatedDateisundefinedinitially while the Onyx data is still loading. As a result, the condition!loginData?.validatedDateevaluates to false, and the navigation logic is triggered.
What changes do you think we should make in order to solve the problem?
- We can update the condition here:
if (prevValidatedDate || !loginData?.validatedDate || !loginData) { to the following::
if (prevValidatedDate || prevValidatedDate === undefined || !loginData?.validatedDate || !loginData) {-
In the updated condition, I added
prevValidatedDate === undefinedto address the issue. The purpose of this useEffect is to navigate to the methods page upon successful magic code verification. ThevalidatedDateproperty determines the status of the magic code verification. -
There is a fact that, before validation,
validatedDateis an empty string (''), and it only gets a non-empty value after successful validation. And thatprevValidatedDatecan beundefinedduring the initial load. By addingprevValidatedDate === undefinedto the condition, we ensure the logic works correctly by excluding the case wherevalidatedDateisundefined, effectively fixing the bug.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
@QichenZhu Thanks for the proposal. Your RCA is correct however the solution does not address the root cause. We should avoid updating that onyx key.
24 remaining items
Reviewinglabel has been removed, please complete the "BugZero Checklist".The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.96-1 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-02-19. 🎊
For reference, here are some details about the assignees on this issue:
- @s77rt requires payment through NewDot Manual Requests
- @QichenZhu requires payment automatic offer (Contributor)
@s77rt @MitchExpensify @s77rt 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]
BugZero Checklist:
- [Contributor] Classify the bug:
Bug classification
Source of bug:
- 1a. Result of the original design (eg. a case wasn't considered)
- 1b. Mistake during implementation
- 1c. Backend bug
- 1z. Other:
Where bug was reported:
- 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
- 2b. Reported on staging (eg. found during regression or PR testing)
- 2d. Reported on a PR
- 2z. Other:
Who reported the bug:
- 3a. Expensify user
- 3b. Expensify employee
- 3c. Contributor
- 3d. QA
- 3z. Other:
-
[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: fix: unable to receive New Magic Codes for Primary Contact #55498 (comment)
-
[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.
Bug requires regression test: Yes
Regression Test Proposal Template -
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/471559
Regression Test Proposal
Precondition:
- n/a
Test:
- Go to Settings > Profile > Contact Method
- Tap "New contact method"
- Enter a secondary contact
- Enter the magic code sent to the primary contact
- Tap the secondary contact
- Enter the magic code sent to the secondary contact
- Tap the secondary contact again
- Verify that you land on the contact details page
Do we agree 👍 or 👎
Reacted by Mario MazzottiPayment summary:
- $250 @s77rt requires payment through NewDot Manual Requests
- $250 @QichenZhu requires payment automatic offer (Contributor)
@s77rt @MitchExpensify @QichenZhu @MarioExpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
$250 approved for @s77rt
Reacted by Abdelhafidh Belalia@s77rt, @MitchExpensify, @QichenZhu, @MarioExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@QichenZhu paid and contract ended
Reacted by Qichen Zhu- moved this from Bugs and Follow Up Issues to Done in #expensify-bugs
on Feb 23, 2025
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
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: v9.0.94-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+ck22425@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: iPhone 16/iOS 18
App Component: User Settings
Action Performed:
Expected Result:
Actual Result:
Nothing happens on tapping the main email & secondary contact method in contact methods page
Note: On ND Standalone app - When logging with new gmail account, a page to enter magic code appears to verify the account. After verifying account, tapping on main contact method does not respond
Workaround:
Unknown
Platforms:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @MitchExpensify