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

[Awaiting pending offer] [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page #53007

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

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 23, 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.66-0
Reproducible in staging?: Y
Reproducible in production?: Y
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: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website
  2. Tap on "Settings" on the bottom of the screen
  3. Tap on "Security" and select "Add Copilot"
  4. Select any user as copilot
  5. Select an access level
  6. Tap on "Add Copilot"
  7. On Magic Code page, use the device back button to return to previous page
  8. Verify you are redirected to copilot confirmation page

Expected Result:

When using the device back button to return to previous page on magic code page while adding copilot, the user should land on the copilot confirmation page

Actual Result:

User lands on "Access Level" page instead of copilot confirmation, when using the device back button while in the Magic Code page

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence
Bug6673914_1732346029419.Copilot.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861786354506701472
  • Upwork Job ID: 1861786354506701472
  • Last Price Increase: 2024-11-27
  • Automatic offers:
    • dominictb | Reviewer | 105157484
    • daledah | Contributor | 105157485
Issue OwnerCurrent Issue Owner: @dominictb
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 23, 2024
Copy link

melvin-bot bot commented Nov 23, 2024

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

@daledah
Copy link
Contributor

daledah commented Nov 26, 2024

Edited by proposal-police: This proposal was edited at 2024-11-26 11:01:06 UTC.

Proposal

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

User lands on "Access Level" page instead of copilot confirmation, when using the device back button while in the Magic Code page

What is the root cause of that problem?

  • The MC page is just a modal:

so when pressing on back button, the navigate user to the Access Level page.

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

            <DelegateMagicCodeModal shouldHandleNavigationBack ... /> // can use shouldHandleNavigationBack={Browser.isMobileChrome()}
  • The shouldHandleNavigationBack will be passed down to Modal component:

function Modal({fullscreen = true, onModalHide = () => {}, type, onModalShow = () => {}, children, shouldHandleNavigationBack, ...rest}: BaseModalProps) {

and is used in:

if (shouldHandleNavigationBack) {
window.history.pushState({shouldGoBack: true}, '', null);
window.addEventListener('popstate', handlePopStateRef.current);
}

With this, pressing back button will navigate user to the correct page.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 26, 2024
@twisterdotcom
Copy link
Contributor

twisterdotcom commented Nov 26, 2024

Web:

53007.web.mp4

iOS:

trim.005F5C80-52FD-4509-8356-82F6AC748275.MOV

Android mWeb Chrome:

screen-20241126-232231.mp4

I cannot recreate.

@daledah
Copy link
Contributor

daledah commented Nov 27, 2024

@twisterdotcom I can replicate this bug on the web (by using the browser back button in case MacOS chrome and device back button in case android chrome). In your video, it seems you used the back button within the app, but the OP specified that the device's back button should be used:

Screen.Recording.2024-11-27.at.10.47.24.mov
Screen.Recording.2024-11-27.at.08.56.06.mov

@twisterdotcom
Copy link
Contributor

twisterdotcom commented Nov 27, 2024

Ah, my android device doesn't have a back button, I guess I would need to enable it in the settings. Okay, browser made it much easier. I agree then, this is a bug. Niche though.

@twisterdotcom twisterdotcom reopened this Nov 27, 2024
@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Nov 27, 2024
@melvin-bot melvin-bot bot changed the title mWeb - Copilot - User navigated to incorrect page when using device back button in MC page [$250] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

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

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

melvin-bot bot commented Nov 27, 2024

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

@twisterdotcom twisterdotcom added Weekly KSv2 and removed Daily KSv2 labels Nov 27, 2024
@twisterdotcom twisterdotcom changed the title [$250] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

Upwork job price has been updated to $125

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

Proposal

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

When using the device back button while in the Magic Code page, user lands on "Access Level" page instead of copilot confirmation page.

What is the root cause of that problem?

The RC of the problem is that the copilot confirmation page (ConfirmDelegatePage) contains a modal component DelegateMagicCodeModal which becomes visible when we tap the Add copilot button while the page under the visible modal is the copilot confirmation page (ConfirmDelegatePage).

Our issue occurs because the DelegateMagicCodeModal does not currently include logic that handles hardware / browser back button in order to return to the copilot confirmation page when going back from the modal.

Caution

This issue is present on all platforms where hardware / browser back button is available - this includes Web / Android: mWeb Chrome / iOS: mWeb Safari.

Here's the proof
Web: Chrome iOS: mWeb Safari Android: mWeb Chrome
issue-web.mov
issue-ios-mwebSafari.mp4
issue-android-mWebChrome.mp4

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

Note

  1. The reason I decided to post a proposal is because the other proposal would only solve the issue on mWeb Chrome which I don't consider a complete solution.
  2. Another error of the other proposal is that DelegateMagicCodeModal does not take the shouldHandleNavigationBack prop dirrectly.

In the ValidateCodeActionModal component, pass shouldHandleNavigationBack (true) without any condition, which would ensure we have the same behaviour of the hardware / browser back button on all platforms where this issue is present, as per the Expected result.

Result videos
Web: Chrome iOS: mWeb Safari Android: mWeb Chrome
web.mov
ios.mp4
android.mp4

@daledah
Copy link
Contributor

daledah commented Nov 28, 2024

Just a note for reviewer:

  1. In proposal, I already posted two options in code change:
            <DelegateMagicCodeModal shouldHandleNavigationBack ... /> // can use shouldHandleNavigationBack={Browser.isMobileChrome()}

Use Browser.isMobileChrome() if we only want to fix it in mobile chrome.

  1. In proposal, I mentioned:

The shouldHandleNavigationBack will be passed down to Modal component:

This is simply a case of prop drilling and doesn’t require detailed explanation in the proposal. It should be addressed directly in the PR.

@dominictb
Copy link
Contributor

@ikevin127 Thanks for your proposal but I don't think there're any significant differences between yours and the other. All the minor details can be worked out in implementation phase.

@daledah proposal here LGTM.

C+ Reviewed 🎀👀🎀

Copy link

melvin-bot bot commented Dec 2, 2024

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

@MarioExpensify
Copy link
Contributor

Nice!! Thank you @dominictb, let's move forward with @daledah proposal.

Copy link

melvin-bot bot commented Dec 10, 2024

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

Copy link

melvin-bot bot commented Dec 10, 2024

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

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

Copy link

melvin-bot bot commented Dec 10, 2024

@dominictb @twisterdotcom @dominictb 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 Overdue and removed Weekly KSv2 labels Dec 17, 2024
@twisterdotcom
Copy link
Contributor

twisterdotcom commented Dec 17, 2024

Payment Summary:

@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 17, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-12-17] [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page [Awaiting checklist] [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page Dec 17, 2024
@dominictb
Copy link
Contributor

dominictb commented Dec 18, 2024

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/49445/files#r1889759874

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

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

Test:

  1. Open Settings > Security > Add copilot
  2. Proceed adding copilot until the magic code step
  3. On magic code page, press the device's or browser's back button
  4. Verify that user is redirected to copilot confirmation page

Do we agree 👍 or 👎

@twisterdotcom
Copy link
Contributor

Waiting on @dominictb to accept the Upwork offer now.

@twisterdotcom twisterdotcom changed the title [Awaiting checklist] [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page [Awaiting pending offer] [$125] mWeb - Copilot - User navigated to incorrect page when using device back button in MC page Dec 18, 2024
@twisterdotcom twisterdotcom added the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 18, 2024
Copy link

melvin-bot bot commented Dec 21, 2024

@twisterdotcom @dominictb @daledah @MarioExpensify this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 21, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

@twisterdotcom, @dominictb, @daledah, @MarioExpensify Eep! 4 days overdue now. Issues have feelings too...

@dominictb
Copy link
Contributor

Waiting on @dominictb to accept the Upwork offer now.

@twisterdotcom This is done, thanks.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Dec 23, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

@twisterdotcom, @dominictb, @daledah, @MarioExpensify Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
@MarioExpensify
Copy link
Contributor

MarioExpensify commented Dec 30, 2024

I think this can be closed now, but I'll wait @twisterdotcom to be back
Edit: Moving this to Weekly just to clear up my dashboard

@MarioExpensify MarioExpensify added Weekly KSv2 and removed Daily KSv2 labels Dec 30, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 30, 2024
@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Jan 6, 2025
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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

6 participants