Skip to content

[Due for payment 2025-05-30] [$250] mWeb - Help - Refreshing Help page briefly displays we couldn't find help content message #62215

Closed

Description

@vincdargento

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.1.46-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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): slottwo1vappa1@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote note 10s android 13
App Component: Other

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap help
  3. Refresh the page

Expected Result:

Refreshing Help page must not briefly display we couldn't find help content message.

Actual Result:

Refreshing Help page briefly displays we couldn't find help content message.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021923514807256763357
  • Upwork Job ID: 1923514807256763357
  • Last Price Increase: 2025-05-16
  • Automatic offers:
    • truph01 | Contributor | 107368280
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 16, 2025
  2. melvin-bot commented on May 16, 2025

    @melvin-bot

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

  3. drminh2807 commented on May 16, 2025

    @drminh2807
    Contributor

    Proposal

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

    mWeb - Help - Refreshing Help page briefly displays we couldn't find help content message

    What is the root cause of that problem?

    useRootNavigationState takes a small time to get findFocusedRoute

    const {params, routeName} = useRootNavigationState(() => {
    const focusedRoute = findFocusedRoute(navigationRef.getRootState());
    setExpandedIndex(0);
    return {
    routeName: (focusedRoute?.name ?? '') as Screen,
    params: focusedRoute?.params as Record<string, string>,
    };
    });

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

    We should return nothing when route is empty

    function getHelpContent(styles: ThemeStyles, route: string, isProduction: boolean, expandedIndex: number, setExpandedIndex: (idx: number) => void): ReactNode {
    const routeParts = route.split('/');
    const helpContentComponents: ContentComponent[] = [];
    let activeHelpContent = helpContentMap;
    let isExactMatch = true;

        if (!route) {
            return null;
        }

    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)

    or we can return null in HelpContent by check routeName empty

  4. ryntgh commented on May 16, 2025

    @ryntgh
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-17 02:23:27 UTC.

    Proposal

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

    mWeb - Help - Refreshing Help page briefly displays we couldn't find help content message

    What is the root cause of that problem?

    We immediately shows an error message when no content is found for a route. During page refresh, there's a brief moment when the route information isn't available yet, causing the "We couldn't find any help content for this route" message to appear momentarily before the actual content loads.

    if (helpContentComponents.length === 0) {
    // eslint-disable-next-line react/no-unescaped-entities
    helpContentComponents.push(() => <Text style={styles.textHeadlineH1}>We couldn't find any help content for this route.</Text>);
    }

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

    We can return null or a loading indicator when the route is empty or still loading

    {getHelpContent(styles, route, isProduction, expandedIndex, setExpandedIndex)}

    Return null

                    {route ? (
                        getHelpContent(styles, route, isProduction, expandedIndex, setExpandedIndex)
                    ) : null}

    Or loading indicator with a timeout that will show the error message if the route doesn't become available within a reasonable time

    const [isLoading, setIsLoading] = useState(true);
    const loadingTimeoutRef = useRef<NodeJS.Timeout | null>(null);
    
        useEffect(() => {
            if (loadingTimeoutRef.current) {
                clearTimeout(loadingTimeoutRef.current);
            }
    
            if (route) {
                setIsLoading(false);
            } else {
                setIsLoading(true);
                loadingTimeoutRef.current = setTimeout(() => {
                    setIsLoading(false);
                }, 1000);
            }
    
            return () => {
                if (loadingTimeoutRef.current) {
                    clearTimeout(loadingTimeoutRef.current);
                }
            };
        }, [route]);

    {getHelpContent(styles, route, isProduction, expandedIndex, setExpandedIndex)}

    {isLoading ? (
        <ActivityIndicator style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]} />
    ) : (
        getHelpContent(styles, route, isProduction, expandedIndex, setExpandedIndex)
    )}

    Might need to adjust the styling

    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)

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 16, 2025
  6. melvin-bot commented on May 16, 2025

    @melvin-bot
  7. changed the title [-]mWeb - Help - Refreshing Help page briefly displays we couldn't find help content message[/-] [+][$250] mWeb - Help - Refreshing Help page briefly displays we couldn't find help content message[/+] on May 16, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 16, 2025
  9. melvin-bot commented on May 16, 2025

    @melvin-bot

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

  10. rmoise commented on May 16, 2025

    @rmoise

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-17 10:22:53 UTC.

    Proposal

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

    • When refreshing the Help page, a brief flash of the "We couldn't find help content" message is shown before the correct content appears.

    What is the root cause of that problem?

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

    • When the navigation container is not ready, we should avoid rendering any help content and instead show a loading indicator (or render nothing).

    • We should add a loading state that handles the initial navigation setup:

    const [isLoading, setIsLoading] = useState(true);
    
    // Set loading to false after navigation state is available
    useEffect(() => {
        if (state?.name) {
            setIsLoading(false);
        }
    }, [state?.name]);
    
    // Show loading indicator when state is not ready
    if (isLoading) {
        return <ActivityIndicator />;
    }
    

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

    • We need to test that the Help content shows a loading state when the navigation is not ready, and only renders error messages when navigation is ready but no matching content is found.

    • We should simulate page refreshes and verify that the error message doesn't appear during navigation state initialization.

  11. melvin-bot commented on May 16, 2025

    @melvin-bot

    📣 @rmoise! 📣
    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>
    
  12. 21 remaining items

  13. melvin-bot commented on May 23, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.50-0 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-30. 🎊

    For reference, here are some details about the assignees on this issue:

  14. melvin-bot commented on May 23, 2025

    @melvin-bot

    @hungvu193 @Christinadobrzyn @hungvu193 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]

  15. hungvu193 commented on May 29, 2025

    @hungvu193
    Contributor

    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: https://github.com/Expensify/App/pull/56490/files#r2113055032

    • [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.

    Regression Test Proposal

    Precondition:

    Test:

    1. Go to staging.new.expensify
    2. Tab help.
    3. Reload the page.
    4. Verify that there's a loading indicator while the content of the help page is being fetched.
    5. After the loading indicator disappears, the content of help page appears.

    Do we agree 👍 or 👎

  16. Christinadobrzyn commented on May 29, 2025

    @Christinadobrzyn
    Contributor

    Regression test - https://github.com/Expensify/Expensify/issues/505903

    Payment summary here- #62215 (comment)

    Payment scheduled for tomorrow - moving to daily

  17. melvin-bot commented on Jun 2, 2025

    @melvin-bot

    @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. Christinadobrzyn commented on Jun 2, 2025

    @Christinadobrzyn
    Contributor

    Sorry I was ooo sick on Friday...

    Payment summary here- #62215 (comment)

    @hungvu193 please make sure to request payment via ND. Closing!

  19. garrettmknight commented on Jun 3, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions