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-07-10] [HOLD for payment 2024-07-02] [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link #44213

Closed
3 of 6 tasks
m-natarajan opened this issue Jun 22, 2024 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 22, 2024

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


Version Number: 9.0.1-0
Reproducible in staging?: y
Reproducible in production?: no new feature
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
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. On web, open DM with mobile user, copy the report link and add /duplicates/review to the end of the link. (Example - https://staging.new.expensify.com/r/4796612456700465/duplicates/review
    )
  3. Send it to mobile user.
  4. As mobile user (Android or iOS), open the DM.
  5. Tap on the link.
  6. Tap Keep all.

Expected Result:

App will not crash.

Actual Result:

App crashes on Android and iOS app.
On web, it shows console error.

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari - Console error
  • MacOS: Desktop

Screenshots/Videos

Bug6521589_1719068371303.Screen_Recording_20240622_225622_One_UI_Home.1.mp4

https://platform.utest.com/services/links/v1/internal/51927148?.log

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e59eefc454d9599a
  • Upwork Job ID: 1805181350791543526
  • Last Price Increase: 2024-06-24
  • Automatic offers:
    • bernhardoj | Contributor | 102859572
Issue OwnerCurrent Issue Owner: @OfstadC
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 22, 2024
Copy link

melvin-bot bot commented Jun 22, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jun 22, 2024
@melvin-bot melvin-bot bot added the Daily KSv2 label Jun 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.

Copy link

melvin-bot bot commented Jun 22, 2024

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

@c3024
Copy link
Contributor

c3024 commented Jun 22, 2024

Proposal

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

App crashes when pressing Keep all when reviewing duplicates.

What is the root cause of that problem?

transactionIDs can be '-1' here

const transactionID = ReportActionsUtils.getLinkedTransactionID(reportAction, report?.reportID ?? '-1') ?? '-1';

and when they are mapped over here they are added as undefined in the mapped array here
const currentTransactions = transactionIDs.map((id) => allTransactions?.[id]);
const transactionsReportActions = currentTransactions.map((transaction) => ReportActionsUtils.getIOUActionForReportID(transaction.reportID ?? '', transaction.transactionID ?? ''));

and accessing reportID on undefined crashes the app.

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

Filter the undefined in the mapped array by modifying this

const transactionsReportActions = currentTransactions.map((transaction) => ReportActionsUtils.getIOUActionForReportID(transaction.reportID ?? '', transaction.transactionID ?? ''));

to

const currentTransactions = transactionIDs.map((id) => allTransactions?.[id]).filter((transaction) => transaction);

What alternative solutions did you explore? (Optional)

@m-natarajan
Copy link
Author

@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@m-natarajan
Copy link
Author

We think that this bug might be related to #wave-collect - Release 2

@bernhardoj
Copy link
Contributor

Proposal

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

App crash when choose Keep all in review duplicates page of a DM chat.

What is the root cause of that problem?

When we open a DM chat and manually append the link with /duplicates/review, it will open the duplicate review page for the DM. But because it's a DM, the transactionID here defaults to -1.

const transactionID = ReportActionsUtils.getLinkedTransactionID(reportAction, report?.reportID ?? '-1') ?? '-1';

const transactionIDs = [transactionID, ...duplicateTransactionIDs];

duplicateTransactionIDs is an empty array because there is no duplicate. When we press keep all, it will map the transaction IDs and get the reportID here which will crash the app because there is no transaction with id of -1.

Transaction.dismissDuplicateTransactionViolation(transactionIDs, currentPersonalDetails);

const currentTransactions = transactionIDs.map((id) => allTransactions?.[id]);
const transactionsReportActions = currentTransactions.map((transaction) => ReportActionsUtils.getIOUActionForReportID(transaction.reportID ?? '', transaction.transactionID ?? ''));

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

I think we can show not found page (or any other view, like an empty view saying there is no transaction found) when there is no linked transaction of a report by wrapping the page with FullPageNotFoundView.
<FullPageNotFoundView shouldShow={transactionID === '-1'}>
or
<FullPageNotFoundView shouldShow={!TransactionUtils.getTransaction(transactionID)}>

If we still want to show the page, then we can include the transactionID to the array here only if it's not -1.

const transactionIDs = [transactionID, ...duplicateTransactionIDs];

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jun 24, 2024
@melvin-bot melvin-bot bot changed the title Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

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

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

melvin-bot bot commented Jun 24, 2024

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

@mountiny
Copy link
Contributor

@allroundexperts can you please review the proposals for this blocker?

@allroundexperts
Copy link
Contributor

Yep. I'll finalise in an hour or so.

@allroundexperts
Copy link
Contributor

@c3024's proposal looks good to me. Since showing a not found page is something we can decide on while creating the PR, I would go with the first proposal with the correct RCA.

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Jun 24, 2024

Current assignee @neil-marcellini is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@neil-marcellini
Copy link
Contributor

I'm going to go with @bernhardoj's proposal instead because it's the only one that fully solves the issue. Showing a not found page is the right approach. If we went with the other proposal it wouldn't solve the issue completely, so I think it's most fair to go with the next proposal.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Jun 24, 2024
@neil-marcellini
Copy link
Contributor

I'm going to fix this myself since it's a blocker and Bernhard isn't around right now.

@pecanoro
Copy link
Contributor

pecanoro commented Jun 24, 2024

I think you can remove the blocker labels, this is under a beta. It's also such an edge case that unless you know the codebase and you know you can do it, no one should trigger it 😄

@pecanoro
Copy link
Contributor

Either way, thank you so much for fixing it!

@yuwenmemon yuwenmemon removed the DeployBlocker Indicates it should block deploying the API label Jun 24, 2024
@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Jun 25, 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 Jun 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link [HOLD for payment 2024-07-02] [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link Jun 25, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

Copy link

melvin-bot bot commented Jun 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.1-19 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-07-02. 🎊

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

Copy link

melvin-bot bot commented Jun 25, 2024

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@OfstadC] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: Feat/ Dupe detection review page #41093

@OfstadC
Copy link
Contributor

OfstadC commented Jun 27, 2024

@allroundexperts Could you provide an update on this checklist by EOD? Thank you!

@allroundexperts
Copy link
Contributor

Checklist

  1. Feat/ Dupe detection review page #41093
  2. https://github.com/Expensify/App/pull/41093/files#r1660187883
  3. N/A
  4. A regression test would be helpful. Steps given in the OP look good to me!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 2, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Jul 2, 2024

@allroundexperts Could you please mark off each item completed on the checklist 😃 ? Thanks so much!

Payment Summary:

Contributor: @bernhardoj paid $250 via Upwork
Contributor+: @allroundexperts due $250 via NewDot

@allroundexperts
Copy link
Contributor

allroundexperts commented Jul 2, 2024

@OfstadC I can't edit or mark as complete the checklist message (permission issues). Usually, the C+ just writes the checklist as I did here.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-02] [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [$250] Android - Review duplicate - App crashes when tapping "Keep all" on modified chat link Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

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

Copy link

melvin-bot bot commented Jul 3, 2024

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@OfstadC] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@OfstadC
Copy link
Contributor

OfstadC commented Jul 9, 2024

This was already paid 🤔 - Asking about this here

@OfstadC
Copy link
Contributor

OfstadC commented Jul 9, 2024

Already paid - closing

@OfstadC OfstadC closed this as completed Jul 9, 2024
@JmillsExpensify
Copy link

$250 approved for @allroundexperts

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

No branches or pull requests

10 participants