Skip to content

[Due for payment 2025-05-27] [$250] mWeb - Workspace - Tapping additional approval page shows admin briefly. #61154

Closed

Description

@jponikarchuk

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.38-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: https://expensify.testrail.io/index.php?/tests/view/6022808
Email or phone of affected tester (no customers): Slottwo1 y@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote note 10s android 13
App Component: Workspace Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Go to workspace settings - members
  3. Invite a member
  4. Tap workflows - add approval
  5. Tap additional approval
  6. Upgrade and complete the flow
  7. Tap additional approval again
  8. Refresh the page

Expected Result:

Tapping additional approval page musnt show admin briefly.

Actual Result:

Tapping additional approval page shows admin briefly.

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

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021918279588313523186
  • Upwork Job ID: 1918279588313523186
  • Last Price Increase: 2025-05-02
Issue OwnerCurrent Issue Owner: @zanyrenney

Activity

  1. added
    Bug
    Daily
    on Apr 30, 2025
  2. melvin-bot commented on Apr 30, 2025

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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. mkzie2 commented on Apr 30, 2025

    @mkzie2
    Contributor

    Proposal

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

    Tapping additional approval page shows admin briefly.

    What is the root cause of that problem?

    When first loading the page, the approvalWorkflow Onyx data might not be available yet:

    const [approvalWorkflow] = useOnyx(ONYXKEYS.APPROVAL_WORKFLOW);

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

    Check if that data is still loading using isLoadingOnyxValue util and display FullScreenLoadingIndicator if so.

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

    NA

    What alternative solutions did you explore? (Optional)

    NA

  4. ishakakkad commented on Apr 30, 2025

    @ishakakkad
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-30 07:24:47 UTC.

    Proposal

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

    Workspace - Tapping additional approval page shows admin briefly.

    What is the root cause of that problem?

    We show the list of users based on following condition

    const isEmailAlreadyInApprovers = approversFromWorkflow?.some((approver, index) => approver?.email === email && index !== approverIndex);

    We fetch the approvalWorkflow from here and during refresh approvalWorkflow not present and available after some time

    const [approvalWorkflow] = useOnyx(ONYXKEYS.APPROVAL_WORKFLOW);

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

    To fix this we need to add following logic

    const [approvalWorkflow, metadata] = useOnyx(ONYXKEYS.APPROVAL_WORKFLOW);
    const isLoading = metadata.status === 'loading';
    

    if(isLoading) {
    return null; // OR show loading state
    }

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

    Na

    What alternative solutions did you explore? (Optional)

    const [approvalWorkflow, metadata] = useOnyx(ONYXKEYS.APPROVAL_WORKFLOW);
    const isLoading = isLoadingOnyxValue(metadata);
    

    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.

  5. ishakakkad commented on Apr 30, 2025

    @ishakakkad
    Contributor

    Coming from here, same RCA but different page #60786 (comment)

  6. bernhardoj commented on Apr 30, 2025

    @bernhardoj
    Contributor

    Proposal

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

    The approver list shows the admin briefly.

    What is the root cause of that problem?

    When intiializing the list, we exclude already added user from the list.

    // Do not allow the same email to be added twice
    const isEmailAlreadyInApprovers = approversFromWorkflow?.some((approver, index) => approver?.email === email && index !== approverIndex);
    if (isEmailAlreadyInApprovers && selectedApproverEmail !== email) {
    return null;
    }

    However, approvalWorkflow onyx data is still loading, so the admin member is added to the list briefly.

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

    Return an empty sections when the workflow is still loading.

    const [approvalWorkflow, approvalWorkflowMetadata] = useOnyx(ONYXKEYS.APPROVAL_WORKFLOW);
    const isApprovalWorkflowLoading = isLoadingOnyxValue(approvalWorkflowMetadata);
    
    const sections: ApproverSection[] = useMemo(() => {
        const approvers: SelectionListApprover[] = [];
        console.log('employee list', employeeList, approvalWorkflow)
        if (isApprovalWorkflowLoading) {
            return [];
        }
    

    Then, update shouldShowListEmptyContent so it doesn't show when it's still loading.

    const shouldShowListEmptyContent = !debouncedSearchTerm && approvalWorkflow && !sections.at(0)?.data.length;

    If we want to show loader, pass showLoadingPlaceholder to the list.

    showLoadingPlaceholder={isApprovalWorkflowLoading}
    

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

    N/A

  7. zanyrenney commented on May 2, 2025

    @zanyrenney
    Contributor

    Bunch of proposals 🎉

  8. zanyrenney commented on May 2, 2025

    @zanyrenney
    Contributor

    great find of the related issue @ishakakkad thank you!

  9. added
    External
    on May 2, 2025
  10. changed the title [-]mWeb - Workspace - Tapping additional approval page shows admin briefly.[/-] [+][$250] mWeb - Workspace - Tapping additional approval page shows admin briefly.[/+] on May 2, 2025
  11. 35 remaining items

  12. changed the title [-][$250] mWeb - Workspace - Tapping additional approval page shows admin briefly.[/-] [+][Due for payment 2025-05-27] [$250] mWeb - Workspace - Tapping additional approval page shows admin briefly.[/+] on May 20, 2025
  13. melvin-bot commented on May 20, 2025

    @melvin-bot

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

  14. removed
    Reviewing
    on May 20, 2025
  15. melvin-bot commented on May 20, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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-27. 🎊

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

    • @bernhardoj requires payment through NewDot Manual Requests
    • @alitoshmatov requires payment through NewDot Manual Requests
  16. melvin-bot commented on May 20, 2025

    @melvin-bot

    @alitoshmatov @zanyrenney @alitoshmatov 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. alitoshmatov commented on May 27, 2025

    @alitoshmatov
    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/46798/files#r2108025594

    • [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: No discussion were started

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

    I don't think regression test is needed

  18. added
    Daily
    and removed
    Weekly
    on May 27, 2025
  19. melvin-bot commented on May 27, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@zanyrenney)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1918279588313523186/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  20. zanyrenney commented on May 27, 2025

    @zanyrenney
    Contributor

    Payment Summary

    Upwork Job - cancelled

    Reviewer: @bernhardoj owed $250 via NewDot - please request payment via ND.
    Reviewer: @alitoshmatov owed $250 via NewDot - please request payment via ND.

  21. bernhardoj commented on May 27, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  22. JmillsExpensify commented on May 29, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  23. JmillsExpensify commented on May 29, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @alitoshmatov

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions