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 2023-11-09] [$500] FAB - New workspace option disappears from FAB in offline mode #30138

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 21, 2023 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.3.88-3

Reproducible in staging?: Yes

Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Action Performed:

  1. Navigate to New dot app
  2. Create New account ( FAB menu opens automatically)
  3. Go offline

Expected Result:

New workspace option should be visible and available in offline mode

Actual Result:

New workspace option disappears from FAB in offline mode

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
Bug6245866_1697921954518.IGEX3284.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011387403ef7bf4253
  • Upwork Job ID: 1715851093589565441
  • Last Price Increase: 2023-10-21
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 21, 2023
@melvin-bot melvin-bot bot changed the title FAB - New workspace option disappears from FAB in offline mode [$500] FAB - New workspace option disappears from FAB in offline mode Oct 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011387403ef7bf4253

@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

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

@zukilover
Copy link
Contributor

zukilover commented Oct 21, 2023

Proposal

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

New workspace button does not appear on offline mode

What is the root cause of that problem?

The button is hidden when the loading state: IS_LOADING_REPORT_DATA is true.

...(!props.isLoading && !Policy.hasActiveFreePolicy(props.allPolicies)
? [

This state will not get resolved until the app goes back offline and reconnect app.

App/src/libs/actions/App.js

Lines 251 to 252 in 6031f3e

API.write('ReconnectApp', params, getOnyxDataForOpenOrReconnect());

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

If we want to show the button on offline mode, we do not need to check the loading state to make it visible:

                  ...(!Policy.hasActiveFreePolicy(props.allPolicies)
                        ? [
                              {
                                  icon: Expensicons.NewWorkspace,
                                  iconWidth: 46,
                                  iconHeight: 40,
                                  text: props.translate('workspace.new.newWorkspace'),
                                  description: props.translate('workspace.new.getTheExpensifyCardAndMore'),
                                  onSelected: () => interceptAnonymousUser(() => App.createWorkspaceAndNavigateToIt('', false, '', false, !props.isSmallScreenWidth)),
                              },
                          ]
                        : []),

What alternative solutions did you explore? (Optional)

Also, given that FAB conditionally shows the create workspace button with the hasActiveFreePolicy condition, I wonder if we should do the same for the workspace page (i.e. hide Create new Workspace button if user has any active free policies):

If that's the case, then we can change this line:

footer={
<Button

to:

      footer={
                !Policy.hasActiveFreePolicy(policies)
                    ? (
                        <Button
                            accessibilityLabel={translate('workspace.new.newWorkspace')}
                            success
                            text={translate('workspace.new.newWorkspace')}
                            onPress={() => App.createWorkspaceWithPolicyDraftAndNavigateToIt()}
                        />
                    )
                    : null
            }

@chiragkcodes
Copy link

Proposal

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

New workspace menu item from FAB does not appear when app reconnects after being offline.

What is the root cause of that problem?

I believe this is working as expected. Refer to : #14456.
Current behavior - When app reconnects ONYXKEYS.IS_LOADING_REPORT_DATA becomes false as optimistic data here, which is valid since re-connection might give new policies which should decide whether to show New workspace menu subsequently here

If you observe the screen recording, user pressed FAB menu '+' button while report skeleton was still loading, which says that app was still reconnecting.
In my testing, once 'ReconnectApp' action call completes, ONYXKEYS.IS_LOADING_REPORT_DATA is updated here and New workspace option pops-up.

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

We should not make any changes. Its working as expected. Please let me know if that's invalid conclusion (referring to above reasoning)
Once ReconnectApp action call is successful, menu is popping up as expected.

What alternative solutions did you explore? (Optional)

If we do not want to change New workspace visibility based on ReconnectApp action, we can introduce ONYX.IS_LOADING_INITIAL_REPORT_DATA which will become true once report data is loaded for the first time in session and stay true regardless of connections. If policy data changes, eventually it will be reflected and New workspace option will be removed.

@dukenv0307
Copy link
Contributor

Proposal

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

New workspace option disappears from FAB in offline mode

What is the root cause of that problem?

The New workspace option will be hidden whenever props.isLoading is true. So when the openApp or ReconnectApp API is called, this option will be hidden

...(!props.isLoading && !Policy.hasActiveFreePolicy(props.allPolicies)

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

We can subscribe IS_LOADING_APP from Onyx that is only changed to true when openApp API is called

isLoading: {
    key: ONYXKEYS.IS_LOADING_APP,
},

isLoading: {
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
},

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Oct 24, 2023
@garrettmknight
Copy link
Contributor

@lanitochka17 This doesn't seem very unexpected - can you point me to the test that caught this so I can confirm?

@melvin-bot melvin-bot bot removed the Overdue label Oct 24, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 24, 2023
@lanitochka17
Copy link
Author

@garrettmknight
Copy link
Contributor

Thanks @lanitochka17 - Looks good to me. @allroundexperts either of those proposals look good?

@allroundexperts
Copy link
Contributor

@dukenv0307's proposal looks good to me. I think we should hide this until all policies have loaded (ie first load). Once they are loaded, even if the user becomes offline, we can keep on showing the button.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

Triggered auto assignment to @cead22, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@cead22 cead22 assigned dukenv0307 and unassigned dukenv0307 Oct 26, 2023
@cead22 cead22 added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 26, 2023
@cead22
Copy link
Contributor

cead22 commented Oct 26, 2023

I give up trying to trigger the automation here, any idea what's happening @garrettmknight ?

@dukenv0307
Copy link
Contributor

@allroundexperts The PR is ready for review

@mallenexpensify
Copy link
Contributor

I did a tiny bit of digging and am not sure why the automation didn't happen, @garrettmknight can manually hire. If we see this continue to happen, please post in #bug-zero, ideally in the same thread Carlos started

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 2, 2023
@melvin-bot melvin-bot bot changed the title [$500] FAB - New workspace option disappears from FAB in offline mode [HOLD for payment 2023-11-09] [$500] FAB - New workspace option disappears from FAB in offline mode Nov 2, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

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

Copy link

melvin-bot bot commented Nov 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 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 2023-11-09. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Nov 2, 2023

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 8, 2023
@garrettmknight
Copy link
Contributor

garrettmknight commented Nov 10, 2023

Summarizing payments for this issue:

Upwork issue: https://www.upwork.com/en-gb/ab/applicants/1715851093589565441/job-details

@melvin-bot melvin-bot bot removed the Overdue label Nov 10, 2023
@garrettmknight
Copy link
Contributor

@dukenv0307 offer sent

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
@garrettmknight
Copy link
Contributor

@allroundexperts can you request payment and fill out the checklist when you get a chance?

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@allroundexperts
Copy link
Contributor

@garrettmknight This was a super edge case which is very hard to reproduce as well. I don't think we need a checklist here.

@garrettmknight garrettmknight added Weekly KSv2 and removed Daily KSv2 labels Nov 15, 2023
@garrettmknight
Copy link
Contributor

Dropping to weekly for payment via NewDot

@JmillsExpensify
Copy link

$500 payment approved for @allroundexperts based on this comment.

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 External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants