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-11-09] [$500] Receipt image is opened when opening any other image in the receipt scan room #27824

Closed
1 of 6 tasks
thienlnam opened this issue Sep 20, 2023 · 41 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@thienlnam
Copy link
Contributor

thienlnam commented Sep 20, 2023

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


Action Performed:

  1. Click on the the FAB and request money
  2. Choose scan > then choose file
  3. Choose where you want request the scan from - better choose a workspace to avoid the ( request from new acounts bug ) > then Click Request
  4. Click on the request message to open the IOU room
  5. In the IOU room Click on the scan receipt message to open the scan receipt page ( which contain all the information about the scan request )
  6. Click on the + icon beside the composer and add attachment
  7. Choose image and Click Send
  8. Now click on the image to open it.

Expected Result:

The image we sent should be opened

Actual Result:

The Receipt image is opened. And It is opened by Clicking on any image that sent inside the Receipt scan room

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

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

Version Number: v1.3.71-8
Reproducible in staging?: Y
Reproducible in production?: N
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 supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @Ahmed-Abdella
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695169078652869

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0133dc290a8df838b8
  • Upwork Job ID: 1704393787448082432
  • Last Price Increase: 2023-09-27
  • Automatic offers:
    • dukenv0307 | Contributor | 26981315
    • Ahmed-Abdella | Reporter | 26981319
Issue OwnerCurrent Issue Owner: @ArekChr
@thienlnam thienlnam added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 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

@thienlnam thienlnam added the DeployBlockerCash This issue or pull request should block deployment label Sep 20, 2023
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 20, 2023
@OSBotify
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.

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@Ahmed-Abdella
Copy link
Contributor

Reproduction video
Screencast from 20-09-23 02:52:05.webm

@Ahmed-Abdella
Copy link
Contributor

IMPORTANT NOTICE:
The same behvior is happening for Distance, the map is opened by clicking on any other image in the room

@miljakljajic
Copy link
Contributor

@thienlnam
Copy link
Contributor Author

I am going to remove the deploy blocker from the issue so we can move forward with deploy considering it's been delayed a couple days already. This is a bug we should fix, but doesn't seem like a major bug considering it has to be within the scan details

@thienlnam thienlnam added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title Receipt image is opened when opening any other image in the receipt scan room [$500] Receipt image is opened when opening any other image in the receipt scan room Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

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

melvin-bot bot commented Sep 20, 2023

Current assignee @miljakljajic is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Sep 20, 2023

Proposal

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

Receipt image is opened when opening any other image in the receipt scan room

What is the root cause of that problem?

We're getting the initialPage based on attachmentsFromReport

const compareImage = useCallback(
(attachment) => {
if (attachment.isReceipt) {
const action = ReportActionsUtils.getParentReportAction(report);
const transactionID = _.get(action, ['originalMessage', 'IOUTransactionID']);
return attachment.transactionID === transactionID;
}
return attachment.source === source;
},
[source, report],
);
useEffect(() => {
const attachmentsFromReport = extractAttachmentsFromReport(report, reportActions);
const initialPage = _.findIndex(attachmentsFromReport, compareImage);

In IOU room, the first attachment is always receipt -> this condition always return true

-> the receipt image is shown even when users open other image

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

If we're opening the receipt image, we should use the transactionID to compare instead of source (because the source returned from BE will override the local source -> that makes the attachment modal closes)
Otherwise, we should use source to compare

To achieve that, In AttachmentCarousel, add new state isReceipt to indicate that the opened image is receipt or normal image

then update this condition

to

            if (attachment.isReceipt && isReceipt) {

isReceipt is updated to false in

add setIsReceipt(entry.item.isReceipt) in

Result

Screen.Recording.2023-09-20.at.17.04.38.mp4

@ArekChr
Copy link
Contributor

ArekChr commented Sep 21, 2023

@dukenv0307 Why does the image preview reload after opening the receipt?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Sep 22, 2023

@ArekChr Because the receipt image will be override by the data returned from BE (You can check the url to realize that)

  1. After create the scan request, the receipt image is the local url
  2. Users open the image quickly, it's still the local image
  3. BE returns data and override the local image
  4. The image preview is reloaded to the new one

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

This issue has not been updated in over 15 days. @ArekChr, @miljakljajic, @aldo-expensify, @dukenv0307 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@dylanexpensify
Copy link
Contributor

@ArekChr this is blocking another high value wave 4 issue - can we get this reviewed asap please?

@dylanexpensify dylanexpensify added Hourly KSv2 Daily KSv2 and removed Monthly KSv2 Hourly KSv2 Daily KSv2 labels Oct 27, 2023
@dukenv0307
Copy link
Contributor

@dylanexpensify We are waiting for final review from @aldo-expensify

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Nov 2, 2023
@melvin-bot melvin-bot bot changed the title [$500] Receipt image is opened when opening any other image in the receipt scan room [HOLD for payment 2023-11-09] [$500] Receipt image is opened when opening any other image in the receipt scan room Nov 2, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

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

Copy link

melvin-bot bot commented Nov 2, 2023

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

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:

Copy link

melvin-bot bot commented Nov 2, 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:

  • [@aldo-expensify] The PR that introduced the bug has been identified. Link to the PR:
  • [@aldo-expensify] 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:
  • [@aldo-expensify] 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:
  • [@ArekChr / @dukenv0307] Determine if we should create a regression test for this bug.
  • [@ArekChr / @dukenv0307] 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.
  • [@miljakljajic] 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 and removed Weekly KSv2 labels Nov 8, 2023
@miljakljajic
Copy link
Contributor

offers sent to both @Ahmed-Abdella and @dukenv0307 - let me know when you accept and I'll get them paid right away!

@Ahmed-Abdella
Copy link
Contributor

Hi, @miljakljajic, an offer was already sent before and I accepted it. Should I accept the new one ?

@ArekChr
Copy link
Contributor

ArekChr commented Nov 13, 2023

  • Determine if we should create a regression test for this bug: Yes we can regression test here.

Regression Test Proposal

  1. Click on the FAB to request money.
  2. Click on request money, select 'scan', then select 'file'.
  3. Select a workspace to request the scan, then click 'Request'.
  4. Click on the request message to open the IOU room.
  5. In the IOU room, click on the scan receipt message to view the scan receipt page.
  6. Click on the '+' icon beside the message composer and add an image attachment.
  7. Send the image and then click on it to open.
  8. Verify that the specific image sent should open instead of the image receipt.

Do we agree 👍 or 👎

@miljakljajic
Copy link
Contributor

Apologies @Ahmed-Abdella can you link me the original offer and I'll pay it?

@Ahmed-Abdella
Copy link
Contributor

@miljakljajic
Copy link
Contributor

Paid for both of you, thank you!

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

No branches or pull requests

9 participants