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-11-13] [$250] Copilot - Nothing happens when clicking Add copilot after returning from magic code page #51273

Closed
5 of 8 tasks
IuliiaHerets opened this issue Oct 22, 2024 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 22, 2024

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: 9.0.52-2
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account settings > Security.
  3. Click Add copilot.
  4. Select a user > Next.
  5. Select an access level > Next.
  6. Click Add copilot.
  7. Click RHP back button.
  8. Click Add copilot.

Expected Result:

App will proceed to magic code page.

Actual Result:

Nothing happens when clicking Add copilot after returning from magic code page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6642186_1729610589423.20241022_232027.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021848771830019077606
  • Upwork Job ID: 1848771830019077606
  • Last Price Increase: 2024-10-22
  • Automatic offers:
    • cretadn22 | Contributor | 104557922
Issue OwnerCurrent Issue Owner: @isabelastisser
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

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

Copy link

melvin-bot bot commented Oct 22, 2024

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

Copy link

melvin-bot bot commented Oct 22, 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 22, 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.

@carlosmiceli carlosmiceli added External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment labels Oct 22, 2024
@melvin-bot melvin-bot bot changed the title Copilot - Nothing happens when clicking Add copilot after returning from magic code page [$250] Copilot - Nothing happens when clicking Add copilot after returning from magic code page Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

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

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

A bit of an edge case, can probably be solved quickly so will ask for help from contributors.

Copy link

melvin-bot bot commented Oct 22, 2024

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

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 22, 2024

Proposal

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

Nothing happens when clicking Add copilot after returning from magic code page.

What is the root cause of that problem?

We already setIsValidateCodeActionModalVisible(true) when pressing Add copilot. But when we close the validate code modal, we did not reset the isValidateCodeActionModalVisible so when pressing Add copilot again, setIsValidateCodeActionModalVisible(true) is triggered causing no state changes >> not toggle the modal again.

onPress={() => setIsValidateCodeActionModalVisible(true)}

{isValidateCodeActionModalVisible && (
<DelegateMagicCodeModal

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

Reset isValidateCodeActionModalVisible to false when we navigate back/close the validate code modal.

Introduce onClose prop to DelegateMagicCodeModal and pass from ConfirmDelegatePage:

<DelegateMagicCodeModal
    onClose={() => setIsValidateCodeActionModalVisible(false)}

And pass to ValidateCodeActionModal from DelegateMagicCodeModal.

@cretadn22
Copy link
Contributor

cretadn22 commented Oct 22, 2024

Edited by proposal-police: This proposal was edited at 2024-10-22 17:13:44 UTC.

Proposal

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

Nothing happens when clicking Add copilot after returning from magic code page

What is the root cause of that problem?

We have two isValidateCodeActionModalVisible in DelegateMagicCodeModal and ConfirmDelegatePage. When we navigate back we don't update isValidateCodeActionModalVisible in ConfirmDelegatePage to false

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

Let's remove isValidateCodeActionModalVisible in DelegateMagicCodeModal. Remove this line

const [isValidateCodeActionModalVisible, setIsValidateCodeActionModalVisible] = useState(true);

We only should use one isValidateCodeActionModalVisible state on ConfirmDelegatePage in two places. To do that, we need to pass isValidateCodeActionModalVisible and setIsValidateCodeActionModalVisible from ConfirmDelegatePage

                    isValidateCodeActionModalVisible={isValidateCodeActionModalVisible}
                    setIsValidateCodeActionModalVisible={setIsValidateCodeActionModalVisible}

And use two props on DelegateMagicCodeModal

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.

@jayeshmangwani
Copy link
Contributor

I agree with you proposal @cretadn22. Right now, we have two different state that do the same thing but on different pages, so I think we should handle the hide/show logic from the parent component (ConfirmDelegatePage)

@cretadn22 , could you please check why we're rendering the DelegateMagicCodeModal modal conditionally with the isValidateCodeActionModalVisible check? Is it necessary, or can we simplify it?

{isValidateCodeActionModalVisible && (
<DelegateMagicCodeModal
login={login}
role={role}

@cretadn22
Copy link
Contributor

@jayeshmangwani I believe we can safely remove the isValidateCodeActionModalVisible check since it’s already handled in the DelegateMagicCodeModal. We can also streamline it further in the PR

@jayeshmangwani
Copy link
Contributor

@carlosmiceli Let's go with @cretadn22 's Proposal here. We can use the one source of truth and reference the isValidateCodeActionModalVisible state from the parent only

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 23, 2024

Current assignee @carlosmiceli is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

📣 @cretadn22 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@carlosmiceli carlosmiceli added Daily KSv2 and removed Hourly KSv2 labels Oct 23, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 23, 2024
@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 6, 2024
@melvin-bot melvin-bot bot changed the title [$250] Copilot - Nothing happens when clicking Add copilot after returning from magic code page [HOLD for payment 2024-11-13] [$250] Copilot - Nothing happens when clicking Add copilot after returning from magic code page Nov 6, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

Copy link

melvin-bot bot commented Nov 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.57-10 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-11-13. 🎊

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

Copy link

melvin-bot bot commented Nov 6, 2024

@jayeshmangwani @isabelastisser 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]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 12, 2024
@jayeshmangwani
Copy link
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
  • 2b. Reported on staging (deploy blocker)
  • 2c. 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: Refactor: reuse ValidateCodeActionModal #49445 (comment)

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

    IMO, A dedicated regression test isn't necessary here. If this issue recurs, it should be easily detectable during the usual add copilot flow.

@isabelastisser
Copy link
Contributor

Payment summary:

@jayeshmangwani - $250 for C+ review. Requires payment through NewDot Manual Requests PENDING
@cretadn22 - Contributor - requires payment in Upwork. PAID. automatic offer

@garrettmknight
Copy link
Contributor

$250 approved for @jayeshmangwani

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

No branches or pull requests

7 participants