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 2024-10-30] QBD - Empty link in RHP when network is disconnected while QBD setup is loading #50548

Open
2 of 6 tasks
IuliiaHerets opened this issue Oct 10, 2024 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 10, 2024

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: 9.0.47-1
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #50216
Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Accounting.
  3. Click Connect next to Quickbooks desktop
  4. While RHP is loading, quickly disconnect network.

Expected Result:

RHP will show that the page is offline.

Actual Result:

RHP is loaded with empty link.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6630106_1728513620793.20241010_063732.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @strepanier03
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Oct 10, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 10, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

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

Copy link

melvin-bot bot commented Oct 10, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Oct 10, 2024
Copy link
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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-control

@hoangzinh
Copy link
Contributor

The project is still in beta so I don't think it's a DB.

@hoangzinh
Copy link
Contributor

cc @ZhenjaHorbach @lakchote ^

@ZhenjaHorbach
Copy link
Contributor

It's not really clear what the expected result is
Should we show infinite loading
Or show separate screen to not show empty link

@lakchote
Copy link
Contributor

The project is still in beta so I don't think it's a DB.

It's not a blocker as it's behind beta indeed.

@lakchote lakchote added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Oct 10, 2024
@lakchote
Copy link
Contributor

It's not really clear what the expected result is Should we show infinite loading Or show separate screen to not show empty link

I'd prefer to not show infinite loading when offline, as it would mistakenly make the user think something is going to happen and the link will show. We should find a way to notify him he's offline, and as such, cannot get the setup link.

Let's tag @Expensify/design to see if we already had to handle this situation before, and to have their point of view.

@dannymcclain
Copy link
Contributor

Yeah I agree with not showing a loader forever—that doesn't seem super helpful.

Here are a couple ideas about how to handle this:

1) Replace the link with an offline indicator

If we can automatically update the link box with the link when it's available, this feels like the smoothest option.

image

2) Blast 'em with our blocking offline pattern

If we can't automatically update the link/we actually need them to just try again once they come back online, this pattern might work best.

image

cc @dubielzyk-expensify for thoughts and preferences.

@hoangzinh
Copy link
Contributor

2nd idea looks promising to me 👀

@dubielzyk-expensify
Copy link
Contributor

I think the 2nd idea just for the simplicity and consistency 👍

@strepanier03
Copy link
Contributor

I think the 2nd makes it really clear but the 1st one looks more friendly.

@lakchote
Copy link
Contributor

Thanks for the proposals @dannymcclain!

If the user comes back online, we can fetch the setup link again, thus making option #1 viable.

Code will need to be adjusted either way to take into account going offline cc @hoangzinh :

Example for option #1:

    const {isOffline} = useNetwork();
    useEffect(() => {
        if (isOffline) {
            setCodatSetupLink('');
            setIsLoading(false);
            return;
        }
        const fetchSetupLink = () => {
             //...existing logic
        };
        fetchSetupLink();
    }, [isOffline]);

I'm with @strepanier03, option #1 looks more friendly, but I don't have any hard preference.

If the option #2 is more consistent in terms of what we're doing in our design patterns, let's do #2 as consistency is key.

@daledah
Copy link
Contributor

daledah commented Oct 11, 2024

Proposal

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

RHP is loaded with empty link.

What is the root cause of that problem?

QuickBooksDesktopSetupPage currently doesn't have logics to handle offline case

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

Regarding #50548 (comment)

1. Replace the link with an offline indicator

Update Logics inside this useEffect to handle offline cases

    const {isOffline} = useNetwork();
    useEffect(() => {
        if (isOffline) {
            setCodatSetupLink('');
            setIsLoading(false);
            return;
        }
        const fetchSetupLink = () => {
            // eslint-disable-next-line rulesdir/no-thenable-actions-in-views
            QuickBooksDesktop.getQuickbooksDesktopCodatSetupLink(policyID).then((response) => {
                setCodatSetupLink(String(response?.setupUrl ?? ''));
                setIsLoading(false);
            });
        };
        fetchSetupLink();
    }, [isOffline]);

Add a new text You appear to be offline. Your setup link will be available when you're back online and update offline indicator to this part:

<View style={[styles.qbdSetupLinkBox, styles.mt5]}>
<CopyTextToClipboard
text={codatSetupLink}
textStyles={[styles.textSupporting]}
/>
</View>

<View style={[styles.qbdSetupLinkBox, styles.mt5]}>
                    {!isOffline && (
                        <CopyTextToClipboard
                            text={codatSetupLink}
                            textStyles={[styles.textSupporting]}
                        />
                    )}
                    {isOffline && (
                        <View style={[styles.flexRow, styles.alignItemsCenter]}>
                            <Icon
                                fill={theme.icon}
                                src={Expensicons.OfflineCloud}
                                width={variables.iconSizeSmall}
                                height={variables.iconSizeSmall}
                            />
                            <Text style={[styles.ml3, styles.chatItemComposeSecondaryRowSubText]}>You appear to be offline. Your setup link will be available when you're back online</Text>
                        </View>
                    )}
                </View>

2. Blast 'em with our blocking offline pattern

Wrap this part inside FullPageOfflineBlockingView.

What alternative solutions did you explore? (Optional)

@dannymcclain
Copy link
Contributor

I think the 2nd idea just for the simplicity and consistency 👍

Totally down to go with the full offline screen to keep things consistent across the app. 👍

@hoangzinh
Copy link
Contributor

@lakchote Given this is an edge case, can I put this issue at the end of the queue and focus on other QBD issues?

@lakchote
Copy link
Contributor

@lakchote Given this is an edge case, can I put this issue at the end of the queue and focus on other QBD issues?

Sure!

@lakchote lakchote added Weekly KSv2 and removed Daily KSv2 labels Oct 11, 2024
@ZhenjaHorbach
Copy link
Contributor

@lakchote @dannymcclain
About this issue

If we already have setupLink
Do we need to show OfflineBlockingView on full screen when user is offline ?

@dannymcclain
Copy link
Contributor

🤔 Hmm, I don't think we do if we already have the link. Obviously the user might run into problems opening the link if they're truly offline, but IMO that's not really on us. Open to other perspectives though!

@hoangzinh
Copy link
Contributor

I don't think we do if we already have the link

Yes, I have same thought.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Oct 17, 2024
@lakchote
Copy link
Contributor

@ZhenjaHorbach, I agree with @dannymcclain and @hoangzinh.

@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 23, 2024
@melvin-bot melvin-bot bot changed the title QBD - Empty link in RHP when network is disconnected while QBD setup is loading [HOLD for payment 2024-10-30] QBD - Empty link in RHP when network is disconnected while QBD setup is loading Oct 23, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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

Copy link

melvin-bot bot commented Oct 23, 2024

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

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

Copy link

melvin-bot bot commented Oct 23, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@hoangzinh / @ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:
  • [@hoangzinh / @ZhenjaHorbach] 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:
  • [@hoangzinh / @ZhenjaHorbach] A discussion in #expensify-bugs 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:
  • [@hoangzinh / @ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [@hoangzinh / @ZhenjaHorbach] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants