Skip to content

[HOLD for payment 2025-02-05] [$250] Web - Workspace - "It's not here" error briefly appears when removing a member offline #54938

Description

@mitarachim

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.82-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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/5425265&group_by=cases:section_id&group_id=229065&group_order=asc
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 10 / Chrome
App Component: Workspace Settings

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a Gmail account that is an admin of a workspace with a member
  3. Navigate to Workspace settings - Members
  4. Go offline
  5. Click on the member
  6. Click on the "Remove from workspace" button
  7. Click on the "Remove" button

Expected Result:

"It's not here" error shouldn't be showing.

Actual Result:

"It's not here" error briefly appears when removing a member offline. It's not showing when the removal is done online.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6708802_1736316862690.bandicam_2025-01-08_07-03-50-887.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021877532634645405201
  • Upwork Job ID: 1877532634645405201
  • Last Price Increase: 2025-01-17
  • Automatic offers:
    • truph01 | Contributor | 105793122
Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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. nyomanjyotisa commented on Jan 8, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    When removing a user in offline mode, the page displays FullPageNotFoundView for a second, causing a flicker issue.

    What is the root cause of that problem?

    The root cause is the condition that determines whether to show the NotFoundPage. It does not account for the offline status of the app, leading to the NotFoundPage being displayed momentarily when the user is deleted offline.

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

    We should update the condition that determines whether to show the NotFoundPage to include a check for the offline status. Specifically, we should ensure that the NotFoundPage is not displayed when the app is offline.
    We can add !isOffline in this code

    // eslint-disable-next-line rulesdir/no-negated-variables
    const shouldShowNotFoundPage =
    !member || (member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

        const shouldShowNotFoundPage =
            !member || (member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !isOffline);

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

    What alternative solutions did you explore? (Optional)

    POC

    New-Expensify.mp4
  4. github-actions commented on Jan 8, 2025

    @github-actions
    Contributor

    Marking the comment as NO_ACTION because it follows the proposal template correctly, including all mandatory lines.

  5. huult commented on Jan 9, 2025

    @huult
    Contributor

    Proposal

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

    "It's not here" error briefly appears when removing a member offline

    What is the root cause of that problem?

    When we remove a user offline, the pendingActions will be set to delete.

    Member.removeMembers([accountID], policyID);

    So, when we close the modal to confirm deleting a user, the condition to show the ‘not found’ page becomes true. As a result, we briefly see the ‘not found’ page before the modal closes

    const shouldShowCardsSection = (!!policy?.areExpensifyCardsEnabled && !!paymentAccountID) || (!!policy?.areCompanyCardsEnabled && hasMultipleFeeds);

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

    To resolve this issue, we must create a new flag to prevent showing the ‘not found’ page, something like this:

    1 Create new state

        const [canNavigateBack, setCanNavigateBack] = useState(false);
    1. When a user is removed, we set setCanNavigateBack to true

    const removeUser = useCallback(() => {

        const removeUser = useCallback(() => {
            Member.removeMembers([accountID], policyID);
            setIsRemoveMemberConfirmModalVisible(false);
            setCanNavigateBack(true);
        }, [accountID, policyID]);
    1. Update the condition to display the ‘Not Found’ page

    const shouldShowNotFoundPage =

    Update to

        const shouldShowNotFoundPage =
            !member || (member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !canNavigateBack);

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

    This is a UI component; unit tests are not required.

    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.

  6. trjExpensify commented on Jan 10, 2025

    @trjExpensify
    Contributor

    I can repro this reliably:

    2025-01-10_01-46-39.mp4
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 10, 2025
  8. changed the title [-]Web - Workspace - "It's not here" error briefly appears when removing a member offline[/-] [+][$250] Web - Workspace - "It's not here" error briefly appears when removing a member offline[/+] on Jan 10, 2025
  9. melvin-bot commented on Jan 10, 2025

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 10, 2025
  11. melvin-bot commented on Jan 10, 2025

    @melvin-bot

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

  12. 49 remaining items

  13. changed the title [-][$250] Web - Workspace - "It's not here" error briefly appears when removing a member offline[/-] [+][HOLD for payment 2025-02-05] [$250] Web - Workspace - "It's not here" error briefly appears when removing a member offline[/+] on Jan 29, 2025
  14. melvin-bot commented on Jan 29, 2025

    @melvin-bot

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

  15. melvin-bot commented on Jan 29, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 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-05. 🎊

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

  16. melvin-bot commented on Jan 29, 2025

    @melvin-bot

    @jjcoffee @trjExpensify @jjcoffee 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]

  17. jjcoffee commented on Feb 4, 2025

    @jjcoffee
    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/41492/files#r1941440896

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • Be an admin of a workspace with a member

    Test:

    1. Navigate to Workspace settings -> Members
    2. Go offline
    3. Click on any member
    4. Click on the "Remove from workspace" button
    5. Click on the "Remove" button
    6. Verify that the modal closes without an "It's not here" error showing.

    Do we agree 👍 or 👎

  18. trjExpensify commented on Feb 7, 2025

    @trjExpensify
    Contributor

    Payment summary as follows:

    • $250 to @jjcoffee for the C+ review (go ahead and request!)
    • $250 to @truph01 for the PR (paid!)

    Applause caught this from a regression test that has offline tests for removal, so not proposing a new one. Closing, thanks!

  19. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Feb 7, 2025
  20. garrettmknight commented on Feb 11, 2025

    @garrettmknight
    Contributor

    $250 approved for @jjcoffee

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