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

[Due for payment 2025-02-18] [$500][not here] Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to #55721

Closed
Beamanator opened this issue Jan 24, 2025 · 35 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 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@Beamanator
Copy link
Contributor

Beamanator commented Jan 24, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: ?
Slack conversation #quality:

Action Performed:

  1. Get a report ID from an existing account A (can be concierge report, or chat, expense, whatever)
  2. Log out of Account A
  3. Navigate to the NewDot report link from above while logged out
  4. Log in with Account B that doesn't have access to that report ^

Expected Result:

I'd expect your most recently accessed report, or maybe even Concierge report, would be open instead of being greeted with "Hmm... it's not here"

Actual Result:

See that after you log in, you immediately are greeted with "Hmm... it's not here"
- Example logs from my expensifail account

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882791476183455793
  • Upwork Job ID: 1882791476183455793
  • Last Price Increase: 2025-01-28
  • Automatic offers:
    • OmarKoueifi | Contributor | 105922405
Issue OwnerCurrent Issue Owner: @muttmuure
@Beamanator Beamanator added Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. labels Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@melvin-bot melvin-bot bot changed the title Prevent "Hmm... It's not here" when logging in [$250] Prevent "Hmm... It's not here" when logging in Jan 24, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

Current assignee @muttmuure is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Jan 24, 2025

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 24, 2025
@Beamanator Beamanator changed the title [$250] Prevent "Hmm... It's not here" when logging in Prevent "Hmm... It's not here" when logging in by immediately navigating to a report you have access to Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

@Beamanator Beamanator changed the title Prevent "Hmm... It's not here" when logging in by immediately navigating to a report you have access to Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to Jan 24, 2025
@OmarKoueifi
Copy link
Contributor

Contributor details
Expensify account email: omar.koueifi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~016c1a735b187cb976

@melvin-bot melvin-bot bot added the Overdue label Jan 27, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

📣 @OmarKoueifi! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@OmarKoueifi
Copy link
Contributor

Contributor details
Your Expensify account email: omar.koueifi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~016c1a735b187cb976

Copy link

melvin-bot bot commented Jan 27, 2025

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@OmarKoueifi
Copy link
Contributor

Proposal

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

The issue arises when a user navigates to a report they do not have access to (e.g., due to permission issues or the report being restricted). Instead of a smooth fallback mechanism, the user currently sees a message that says: "Hmm... it's not here. You don't have access to this chat".

What is the root cause of that problem?

The root cause lies in the openReportFromDeepLink function in src/libs/actions/Report.ts. After sign-in/sign-up, this function attempts to navigate to the report without first verifying the user's access. Consequently, the app loads the report page, and only then checks permissions, resulting in the error message being displayed.

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

  1. Modify the handleDeeplinkNavigation logic inside waitForUserSignIn().then to include a pre-check for report access:
    • Use const report = getReport(reportID); to fetch the report details.
    • If report is undefined, it indicates the user does not have access to the report.
  2. Implement a fallback mechanism:
    • If the user lacks access, navigate them to a more appropriate screen, such as:
      • The Home Screen
      • The "Recently Accessed Reports" screen
      • The "Concierge Report" (depending on team preference).
    • Ensure valid deep links continue to function as expected for users with the appropriate permissions.

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

  1. Public Report Access:
    • Verify that users signing in with a public room link are able to access the report without issues.
  2. Private Report Access:
    • Verify that users signing in with a private room link, which they have permission to access, are able to open the report successfully.
  3. Restricted Access:
    • Verify that users signing in with a private room link, which they do not have permission to access, are redirected to the appropriate fallback screen (e.g., Home Screen or Concierge Report) instead of seeing the error message: "Hmm... it's not here. You don't have access to this chat."

What alternative solutions did you explore? (Optional)

NA

@ijmalik
Copy link
Contributor

ijmalik commented Jan 27, 2025

Proposal

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

Prevent the "Hmm... It's not here" message during login by promptly navigating the user to a report they can access

What is the root cause of that problem?

New requirement

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

Introduce a new prop, redirectLastAccessedReport, in the FullPageNotFoundView component. This prop will handle redirection to the most recently accessed report when enabled.

add following code at

    if (redirectLastAccessedReport) {
        const lastAccessedReport = findLastAccessedReport(false, false, '');
        const lastAccessedReportID = lastAccessedReport?.reportID;
        const lastAccessedReportRoute = ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID);
        Navigation.navigate(lastAccessedReportRoute);
        return null;
    }

And when calling FullPageNotFoundView, pass redirectLastAccessedReport as true for redirection where required

Examples:
pass redirectLastAccessedReport prop at
1-

shouldShow={shouldShowNotFoundPage}

redirectLastAccessedReport = {shouldShowNotFoundPage}

2-

<FullPageNotFoundView shouldShow={shouldShowNotFoundPage}>

<FullPageNotFoundView shouldShow={shouldShowNotFoundPage} redirectLastAccessedReport = {shouldShowNotFoundPage}>

3-

redirectLastAccessedReport = {shouldShowNotFoundPage}

4-

redirectLastAccessedReport = {shouldShow}

5-

<FullPageNotFoundView shouldShow={shouldShowBlockingView}>

<FullPageNotFoundView shouldShow={shouldShowBlockingView} redirectLastAccessedReport = {shouldShowBlockingView}>

6-

            <FullPageNotFoundView
                shouldShow
                redirectLastAccessedReport

Extend to Other Components
Similarly, we can analyze and optimize other components, such as AccessOrNotFoundWrapper, using the same approach applied to FullPageNotFoundView, if necessary.

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

Automated Test Scenarios
To ensure the issue does not reoccur, automated tests should comprehensively cover the following scenario:

Validate that upon login:
The application opens either:
The most recently accessed report available to the user.
Or the Concierge report (as a fallback).
Ensure that the user is not greeted with the "Hmm... It's not here" message.
This testing ensures proper redirection behavior and eliminates the risk of inaccessible reports disrupting the user experience.

Note:
The code will be further optimized during the PR process.

I have tested the following links, and they are functioning correctly after the changes.

55721-testCases-1.txt

Videos:

Before:

55721-Before-1.mp4

After:

55721-After-1.mp4

@Beamanator
Copy link
Contributor Author

@rushatgabhane looks like you've got a few proposals to review :D

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 3, 2025
Beamanator added a commit that referenced this issue Feb 5, 2025
@mallenexpensify mallenexpensify changed the title [$500] Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to [$500][not here] Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to Feb 10, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 11, 2025
@melvin-bot melvin-bot bot changed the title [$500][not here] Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to [Due for payment 2025-02-18] [$500][not here] Prevent "Hmm... It's not here" when logging in by immediately navigating to a report user has access to Feb 11, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 11, 2025
Copy link

melvin-bot bot commented Feb 11, 2025

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

Copy link

melvin-bot bot commented Feb 11, 2025

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

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

Copy link

melvin-bot bot commented Feb 11, 2025

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rushatgabhane] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@rushatgabhane
Copy link
Member

This is a new feature.
Regression steps:

Test Access When Logged Out and Switching Accounts

  1. On Account A, navigate to any report (e.g., a concierge, chat, or expense report) and note the report ID.
  2. Log out of Account A.
  3. Open the report URL using the noted report ID (e.g., https://staging.new.expensify.com/r/72105063) while logged out.
  4. Log in with Account B, which doesn't have access to the selected report.

Expected Result: The app should redirect to your most recently accessed report (or the Concierge report) rather than displaying "Hmm... it's not here".

Test Access When Already Signed In (Unauthorized Report)

  1. Log in with an account that should not have access to a specific report.
  2. Navigate directly to the report using its link.

Expected Result: The app should display "Hmm... it's not here" to indicate access is not permitted.

Test Access When Already Signed In (Authorized Report)

  1. Log in with an account that has access to a known report.
  2. Navigate to the report using its link.

Expected Result: The report opens normally without any redirection or error messages.

@muttmuure muttmuure removed their assignment Feb 14, 2025
@muttmuure
Copy link
Contributor

Heading out on leave - adding auto-assigner

@muttmuure muttmuure added the Bug Something is broken. Auto assigns a BugZero manager. label Feb 14, 2025
Copy link

melvin-bot bot commented Feb 14, 2025

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Daily KSv2 Overdue labels Feb 14, 2025
@dylanexpensify
Copy link
Contributor

Payment summary:

Contributor: @OmarKoueifi $250 via Upwork
Contributor+: @rushatgabhane $250 via NewDot

Please apply/request!

@github-project-automation github-project-automation bot moved this from CRITICAL to Done in [#whatsnext] #quality Feb 18, 2025
@garrettmknight
Copy link
Contributor

garrettmknight commented Feb 19, 2025

$500 approved for @rushatgabhane

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 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
Status: Done
Development

No branches or pull requests

9 participants