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 2023-10-30] [$500] Chat - Another report is displayed when access the report detail page by deep link #28641

Closed
3 of 6 tasks
lanitochka17 opened this issue Oct 2, 2023 · 33 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 2, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open a report
  2. Send a message
  3. Create a workspace
  4. Go to the announce chat room
  5. Click on header to open detail page
  6. Copy the URL
  7. Logout and login again with this URL
  8. Notice the report screen is displayed

Expected Result:

The report screen should display the report that matches with reportID param in the URL

Actual Result:

The detail page is the detail page of announce room but the report screen displays another report

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • MacOS / Chrome / Safari
  • Windows / Chrome
  • MacOS / Desktop

Version Number: 1.3.76-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:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional
https://github.com/Expensify/App/assets/78819774/8b0bee74-b1a7-4a7e-8bf9-7c9125b2f7bb

Screencast.from.02-10-2023.14_13_36.webm
Recording.128.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dukenv0307

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696230613828629

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e25fea022af2f13a
  • Upwork Job ID: 1708911256957870080
  • Last Price Increase: 2023-10-16
  • Automatic offers:
    • hoangzinh | Reviewer | 27234356
    • dukenv0307 | Contributor | 27234359
    • dukenv0307 | Reporter | 27234362
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 2, 2023
@melvin-bot melvin-bot bot changed the title Chat - Another report is displayed when access the report detail page by deep link [$500] Chat - Another report is displayed when access the report detail page by deep link Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

Triggered auto assignment to @kevinksullivan (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

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

melvin-bot bot commented Oct 2, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@lanitochka17
Copy link
Author

Proposal

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

Another report is displayed when access the report detail page by deep link

What is the root cause of that problem?

In getLastAccessedReportID function, we only return the current reportID in route if it's an attachment URL. So when we open the other sub-report URL this will return the last active report of the user

const getLastAccessedReportID = (reports, ignoreDefaultRooms, policies, isFirstTimeNewExpensifyUser, openOnAdminRoom) => {
// If deeplink url is of an attachment, we should show the report that the attachment comes from.
const currentRoute = Navigation.getActiveRoute();
const matches = CONST.REGEX.ATTACHMENT_ROUTE.exec(currentRoute);

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

We should use ReportUtils.parseReportRouteParams function to get reportID in the param from the route and return it if exists

const getLastAccessedReportID = (reports, ignoreDefaultRooms, policies, isFirstTimeNewExpensifyUser, openOnAdminRoom) => {
    // If deeplink url contains reportID params, we should show the report that has this reportID.
    const currentRoute = Navigation.getActiveRoute();
    const { reportID } = ReportUtils.parseReportRouteParams(currentRoute);
    console.log(reportID);
    if (reportID) {
        return reportID;
    }
    const lastReport = ReportUtils.findLastAccessedReport(reports, ignoreDefaultRooms, policies, isFirstTimeNewExpensifyUser, openOnAdminRoom);
    return lodashGet(lastReport, 'reportID');
};

const getLastAccessedReportID = (reports, ignoreDefaultRooms, policies, isFirstTimeNewExpensifyUser, openOnAdminRoom) => {
// If deeplink url is of an attachment, we should show the report that the attachment comes from.
const currentRoute = Navigation.getActiveRoute();
const matches = CONST.REGEX.ATTACHMENT_ROUTE.exec(currentRoute);

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.02-10-2023.14.34.22.webm

@hoangzinh
Copy link
Contributor

@dukenv0307 Thanks for your proposal. I think your RCA is not really correct. Before we jump to the getLastAccessedReportID function, we already checked the reportID in the route here

// Don't update if there is a reportID in the params already
if (lodashGet(route, 'params.reportID', null)) {
App.confirmReadyToOpenApp();
return;
}

Could you help to investigate the root cause again? Thanks

@hoangzinh
Copy link
Contributor

@lanitochka17 it seems you missed clarifying it is a proposal of @dukenv0307 in this comment #28641 (comment), isn't it?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 4, 2023

Thanks for your proposal. I think your RCA is not really correct. Before we jump to the getLastAccessedReportID function, we already checked the reportID in the route here

@hoangzinh We already checked the reportID in the route but after signing the route doesn't contain reportID param. That is the reason in getLastAccessedReportID, we check the reportID in attachment route

Screenshot from 2023-10-04 11-12-13

Because the deep link is RightModalNavigator screen but ReportScreen is CentralPaneNavigator, it has initialParams here

initialParams={{openOnAdminRoom: openOnAdminRoom ? 'true' : undefined}}

@hoangzinh
Copy link
Contributor

@dukenv0307 Thanks for your investigation. You're right that it seems a designed purpose when it lets getting the reportID param based on the helper function findLastAccessedReport in this case

/**
* Adds report route without any specific reportID to the state.
* The report screen will self set proper reportID param based on the helper function findLastAccessedReport (look at ReportScreenWrapper for more info)
*

Therefore, your proposal here #28641 (comment) looks good to me. Your proposal has a correct RCA, we're only supporting the attachment route at the moment. You proposed an improvement so that it supports all other routes that contains reportID.

I suggest we go with @dukenv0307's proposal #28641 (comment)

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

@madmax330, @hoangzinh, @kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@kevinksullivan
Copy link
Contributor

Are we waiting on @madmax330 to weigh in here?

#28641 (comment)

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

@madmax330, @hoangzinh, @kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@madmax330 @hoangzinh @kevinksullivan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@hoangzinh
Copy link
Contributor

Are we waiting on @madmax330 to weigh in here?

#28641 (comment)

@kevinksullivan ah yes

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

Offer link
Upwork job

@dukenv0307
Copy link
Contributor

@hoangzinh The PR is ready for review.

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

🎯 ⚡️ Woah @hoangzinh / @dukenv0307, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dukenv0307 got assigned: 2023-10-17 07:00:11 Z
  • when the PR got merged: 2023-10-19 19:44:45 UTC

On to the next one 🚀

@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - Another report is displayed when access the report detail page by deep link [HOLD for payment 2023-10-30] [$500] Chat - Another report is displayed when access the report detail page by deep link Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

  • [@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
  • [@hoangzinh] 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:
  • [@hoangzinh] A discussion in #expensify-bugs 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:
  • [@hoangzinh] Determine if we should create a regression test for this bug.
  • [@hoangzinh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 29, 2023
@madmax330
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Oct 31, 2023
@hoangzinh
Copy link
Contributor

hoangzinh commented Oct 31, 2023

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: ⛔ I think it's an enhancement of previous work in this PR fix: 23958 reload attachment preview and close, app displays random chat for few seconds #25521
  • 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
  • A discussion in #expensify-bugs 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
  • Determine if we should create a regression test for this bug: 🟢 Yes
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

@hoangzinh
Copy link
Contributor

Regression Test Proposal

Note: Currently, The PR is only tested on Web/mWeb

  1. Create a new workspace
  2. Go to the admin room
  3. Click on header to open detail page
  4. Copy the URL
  5. Logout and login again with the URL
  6. Verify that the detail page is opened and the report screen displays the admin room

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Nov 3, 2023
@madmax330
Copy link
Contributor

I'm not sure we need a regression test for this thoughts @kevinksullivan ?

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@kevinksullivan
Copy link
Contributor

Agreed @madmax330

@kevinksullivan
Copy link
Contributor

Paid out!

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

No branches or pull requests

5 participants