Skip to content

[$250] Blank RHP opens for a moment when validating a new contact method #53772

Closed

Description

@IuliiaHerets

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: 53762
Reproducible in staging?: Yes
Reproducible in production?: No
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: https://expensify.testrail.io/index.php?/tests/view/5315884
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team

Action Performed:

  1. Sing in to staging.new.expensify.com
  2. Navigate to settings > Profile
  3. Add a new contact method
  4. Enter magic code sent for the primary contact method
  5. Click on the newly added contact method to validate

Expected Result:

RHP opens prompting to enter a magic code sent to the secondary contact email address.

Actual Result:

A blank RHP is displayed for a moment when clicking on validating secondary contact method.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6689144_1733767327758.bandicam_2024-12-09_20-47-30-983.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866199762317784844
  • Upwork Job ID: 1866199762317784844
  • Last Price Increase: 2024-12-09
Issue OwnerCurrent Issue Owner: @rayane-djouah

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 9, 2024
  2. melvin-bot commented on Dec 9, 2024

    @melvin-bot

    Triggered auto assignment to @amyevans (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Dec 9, 2024

    @melvin-bot

    Triggered auto assignment to @lschurr (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.

  4. melvin-bot commented on Dec 9, 2024

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Dec 9, 2024

    @github-actions
    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.
  6. amyevans commented on Dec 9, 2024

    @amyevans
    Contributor

    Demoting it to not block deploy and opening up for external proposals.

  7. 5 remaining items

  8. melvin-bot commented on Dec 9, 2024

    @melvin-bot

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

  9. FitseTLT commented on Dec 9, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Blank RHP opens for a moment when validating a new contact method

    What is the root cause of that problem?

    This is a regression from #53475 The PR intended to solve animation bug by delaying the appearance of the modal via runAfterInteraction

    useEffect(() => {
    if (isVisibleProp) {
    InteractionManager.runAfterInteractions(() => {
    setIsVisible(true);
    });
    return;
    }
    setIsVisible(false);
    }, [isVisibleProp]);

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

    We can apply the same fix in other less general modal components instead of on BaseModal which would affect several places like the one here.
    For instance to solve the original problem we can apply the delay in AttachmentModal

    isVisible={isModalOpen}

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

  10. luacmartins commented on Dec 9, 2024

    @luacmartins
    Contributor

    cc @chrispader can you work on a fix since it's coming from your PR? cc @ikevin127 @mountiny

  11. daledah commented on Dec 9, 2024

    @daledah
    Contributor

    Proposal

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

    A blank RHP is displayed for a moment when clicking on validating secondary contact method.

    What is the root cause of that problem?

    We are navigating to ContactMethodDetailsPage when user clicks contact method item here

    onPress={() => Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.getRoute(partnerUserID, navigateBackTo))}

    And in component ContactMethodDetailsPage we check the condition to show ValidateCodeActionModal

    <ValidateCodeActionModal
    title={formattedContactMethod}
    onModalHide={() => {}}
    hasMagicCodeBeenSent={hasMagicCodeBeenSent}
    isVisible={isValidateCodeActionModalVisible && !loginData.validatedDate && !!loginData}
    validatePendingAction={loginData.pendingFields?.validateCodeSent}
    handleSubmitForm={(validateCode) => User.validateSecondaryLogin(loginList, contactMethod, validateCode)}
    validateError={!isEmptyObject(validateLoginError) ? validateLoginError : ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}
    clearError={() => User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')}
    onClose={() => {
    Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
    setIsValidateCodeActionModalVisible(false);
    }}
    sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)}
    descriptionPrimary={translate('contacts.enterMagicCode', {contactMethod})}
    />

    the blank screen we see in the video at OP, it is rendering ContactMethodDetailsPage. When isValidateCodeActionModalVisible is set to true then navigate to ValidateCodeActionModal

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

    1. We should move ValidateCodeActionModal in the ContactMethodDetailsPage component to a component ContactMethodDetailsValidateModal like we did with others validate modal

    2. Create a new ROUTE for ContactMethodDetailsValidateModal component

    3. We should update onPress function in ContactMethodsPage, will navigate to ContactMethodDetailsValidateModal when this contact method is not validated yet.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    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.

  12. amyevans commented on Dec 9, 2024

    @amyevans
    Contributor

    Looks like the original PR is being reverted. Assigning @chrispader to handle during reintroduction of the code!

    Edit: @chrispader please comment so I can assign you 😄

  13. removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 9, 2024
  14. ikevin127 commented on Dec 9, 2024

    @ikevin127
    Contributor

    This is what the PRs #53475 description says:

    Explanation of Change

    This PR includes a temporary fix for the slide in animations of modal screens like the ProfileAvatar screen. The reason the animation was not visible is because the screens with NativeStack only get mounted once we navigate there and the screen has not finished rendering/mounting when the modal animates in.

    Similarly, when we animate the modal out, we'll have to delay the back navigation by the modal animation duration.

    Ultimately, we should think about migrating react-native-modal/RN Modal screens to @react-navigation modal screens.

    Since this was pushed as a temporary fix, I wouldn't revert the PR for seeing blank RHP "for a moment", but if that's the recommended course here and there is a stronger argument for not wanting this blank RHP "for a moment" vs the modals not animating in/out then feel free to proceed.

    cc @chrispader @mountiny @ishpaul777 for more context on the discussion where the PR revert was suggested and your take on whether we should actually revert or not given the issue is not a blocker for users in any way

    Edit: Looks like there's a 2nd regression here:

  15. added
    ReviewingHas a PR in review
    and removed on Dec 9, 2024
  16. self-assigned this
    on Dec 9, 2024
  17. luacmartins commented on Dec 9, 2024

    @luacmartins
    Contributor

    Fixed in staging after the revert

    Screen.Recording.2024-12-09.at.3.44.44.PM.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions