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-14] [#wave-control][Copilot] Better handling for copilot setting errors #51356

Closed
dangrous opened this issue Oct 23, 2024 · 17 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

Comments

@dangrous
Copy link
Contributor

dangrous commented Oct 23, 2024

E/A Copy of https://github.com/Expensify/Expensify/issues/431681 for external assignment

Problem

There are many errors that can happen when adding, removing, or updating the role of a copilot. Currently though, these are incorrectly all converted to a "incorrect magic code" error on the front end, which is confusing and unhelpful to any user encountering them

Why is this important?

We want people to be able to fix the issues, or at least know about them, in order to keep using our product.

Solution

Update the error handling for AddDelegate to send onyx errors to the front end. Ensure that they are visible in the right place. We should probably send just to account.delegatedAccess.errorFields We only need the Your account is not validated error as far as I can tell, though it's easy to update for others in case.

The errors are:

  • AddDelegate
    • 400 Invalid role for Copilot: [role] - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
    • 401 Not authorized - Invalid validateCode
    • 401 Request rejected - too many attempts
    • 401 Delegator account must be validated
    • 406 Trying to make themselves a delegate
    • 421 Delegates are not authorized to add delegates - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
  • UpdateDelegateRole
    • 400 Invalid role for Copilot: [role] - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
    • 401 Not authorized - Invalid validateCode
    • 401 Delegator account must be validated
    • 404 Delegate not found - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
    • 406 Trying to update their own role - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
    • 421 Delegates are not authorized to modify delegates - This doesn't need to be visible because it shouldn't happen without the user actively trying something weird to get it
Issue OwnerCurrent Issue Owner: @johncschuster
@dangrous dangrous added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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

@allgandalf
Copy link
Contributor

wowww 😮, how did we miss out this error handling while working on the project. loop me in if this needs a C+ review too

@dangrous
Copy link
Contributor Author

Cool, thank you! Yeah I think we can grab you for review once the PR is ready cc @rushatgabhane .

@dangrous
Copy link
Contributor Author

hi @rushatgabhane do you think this will be ready for review on Monday? thanks!

@rushatgabhane
Copy link
Member

hello, yes we should get it ready for review on monday

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 28, 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 7, 2024
@melvin-bot melvin-bot bot changed the title [#wave-control][Copilot] Better handling for copilot setting errors [HOLD for payment 2024-11-14] [#wave-control][Copilot] Better handling for copilot setting errors Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

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

Copy link

melvin-bot bot commented Nov 7, 2024

@rushatgabhane @johncschuster 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]

@johncschuster
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:

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

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

Regression Test Proposal Template
  • [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:

Test:

Do we agree 👍 or 👎

@dangrous
Copy link
Contributor Author

assigning @Ollyws for payment for PR review

@johncschuster
Copy link
Contributor

Payment Summary:

Contributor: @rushatgabhane - payment will be issued for the larger project (no payment required here)
Contributor+: @Ollyws due $250 via NewDot

@johncschuster
Copy link
Contributor

@rushatgabhane can you complete the BZ Checklist above when you have a moment?

@rushatgabhane
Copy link
Member

I'm not the C+ here, @Ollyws is 😄

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@johncschuster)

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

@Ollyws
Copy link
Contributor

Ollyws commented Nov 14, 2024

BugZero Checklist:

  • [Contributor] Classify the bug: New feature, refactor.
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: Refactor

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other: Refactor

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: N/A

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

Regression Test Proposal

Precondition:

Test:

Verify error cases for all copilot flows.
Connect

    1. Go to account switcher
    2. Switch to another account.
    3. In case of a failure, Verify that you see error message

Disconnect

    1. Switch to another account.
    2. Switch back to your account.
    3. In case of a failure, Verify that you see error message

Add copilot

    1. Go to settings > security
    2. Add copilot
    3. Enter wrong code
    4. Verify you see error
    5. Enter wrong code multiple times
    6. Verify you see error like "too many attempts"

Update copilot role

    1. Go to settings > security
    2. Click a copilot > update role
    3. Enter wrong code
    4. Verify you see error
    5. Enter wrong code multiple times
    6. Verify you see error like "too many attempts"

Do we agree 👍 or 👎

@Ollyws
Copy link
Contributor

Ollyws commented Nov 14, 2024

Requested in ND.

@garrettmknight
Copy link
Contributor

$250 approved for @Ollyws

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
Projects
None yet
Development

No branches or pull requests

6 participants