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

[$500] IOU–Finished Receipt Scanning has whisper 'Only visible to you' if create it in new workspace #42277

Closed
4 of 6 tasks
izarutskaya opened this issue May 16, 2024 · 43 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@izarutskaya
Copy link

izarutskaya commented May 16, 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: v1.4.74-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4562917
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in as Employee of a new Collect workspace.
  3. Navigate to the workspace chat
  4. Select the option to Submit expense > Scan receipt
  5. Select the option to upload a receipt
  6. Upload a receipt file
  7. Click on Submit expense

Expected Result:

Whisper 'Only visible to you' appears when receipt is scanning and disappears when scanning is finished

Actual Result:

Whisper 'Only visible to you' appears only after scanning is finished and not disappears. Admin can’t see finished scanning.

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
  • MacOS: Desktop

Screenshots/Videos

Bug6482398_1715838821602.Scan.mp4

Bug6482398_1715839469282!Receipt_Example2

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0150a29c219ff1ecec
  • Upwork Job ID: 1792357207472001024
  • Last Price Increase: 2024-06-20
Issue OwnerCurrent Issue Owner: @sobitneupane
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 16, 2024
Copy link

melvin-bot bot commented May 16, 2024

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

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

@melvin-bot melvin-bot bot changed the title IOU–Finished Receipt Scanning has whisper 'Only visible to you' if create it in new workspase [$250] IOU–Finished Receipt Scanning has whisper 'Only visible to you' if create it in new workspase May 20, 2024
@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@jliexpensify
Copy link
Contributor

This is a bug because logically, only visible to you should disappear after a successful SmartScan.

Copy link

melvin-bot bot commented May 23, 2024

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

@melvin-bot melvin-bot bot added the Overdue label May 23, 2024
@jliexpensify
Copy link
Contributor

Waiting for proposals.

1 similar comment
@sobitneupane
Copy link
Contributor

Waiting for proposals.

@melvin-bot melvin-bot bot removed the Overdue label May 24, 2024
Copy link

melvin-bot bot commented May 27, 2024

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

@melvin-bot melvin-bot bot added the Overdue label May 27, 2024
Copy link

melvin-bot bot commented May 27, 2024

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

@sobitneupane
Copy link
Contributor

Waiting for proposals.

@melvin-bot melvin-bot bot removed the Overdue label May 28, 2024
Copy link

melvin-bot bot commented May 30, 2024

@sobitneupane @jliexpensify 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 melvin-bot bot added the Overdue label May 30, 2024
@sobitneupane
Copy link
Contributor

Waiting for proposals.

@melvin-bot melvin-bot bot removed the Overdue label May 31, 2024
Copy link

melvin-bot bot commented Jun 3, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

@sobitneupane @jliexpensify 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 Jun 13, 2024
@jliexpensify jliexpensify changed the title [$250] IOU–Finished Receipt Scanning has whisper 'Only visible to you' if create it in new workspace [$500] IOU–Finished Receipt Scanning has whisper 'Only visible to you' if create it in new workspace Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

Upwork job price has been updated to $500

@jliexpensify
Copy link
Contributor

Increased the bounty

@sobitneupane
Copy link
Contributor

Waiting on proposal.

@melvin-bot melvin-bot bot removed the Overdue label Jun 14, 2024
@jp928
Copy link
Contributor

jp928 commented Jun 14, 2024

Proposal

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

Whisper 'Only visible to you' should disappear when scanning is finished

What is the root cause of that problem?

in the src/libs/ReportActionsUtils.ts::getWhisperedTo, the logic relies on originalMessage.
Screenshot 2024-06-15 at 12 58 15 AM

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

Update the function getWhisperedTo relies on reportAction?.message only, not reportAction?.originalMessage

What alternative solutions did you explore? (Optional)

NA

Copy link

melvin-bot bot commented Jun 17, 2024

@sobitneupane, @jliexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
@jliexpensify
Copy link
Contributor

Hi @sobitneupane we have our first proposal 😓 any thoughts?

@sobitneupane
Copy link
Contributor

Thanks for your proposal @jp928.

More details on the RCA of the issue will be very helpful.

As per the comment above the getWhisperedTo function, we would want to use reportAction?.originalMessage for now. The function was introduced by #41856 PR.

/**
* We are in the process of deprecating reportAction.originalMessage and will be setting the db version of "message" to reportAction.message in the future see: https://github.com/Expensify/App/issues/39797
* In the interim, we must check to see if we have an object or array for the reportAction.message, if we have an array we will use the originalMessage as this means we have not yet migrated.
*/
function getWhisperedTo(reportAction: OnyxInputOrEntry<ReportAction> | EmptyObject): number[] {
const originalMessage = reportAction?.originalMessage;
const message = reportAction?.message;
if (!Array.isArray(message) && typeof message === 'object') {
return (message as ReportActionMessageJSON)?.whisperedTo ?? [];
}
if (originalMessage) {
return (originalMessage as ReportActionMessageJSON)?.whisperedTo ?? [];
}
return [];
}

@melvin-bot melvin-bot bot removed the Overdue label Jun 18, 2024
@M00rish
Copy link
Contributor

M00rish commented Jun 18, 2024

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

Whisper 'Only visible to you' does not disappear when scanning is finished

What is the root cause of that problem?

when receipt is submitted the report is created optimistically, using buildOptimisticIOUReportAction function, since the receipt is still in SCANREADY or SCANNING state, the whisperedTo Array is assigned the current user ID.

App/src/libs/ReportUtils.ts

Lines 4096 to 4104 in 8dea185

const originalMessage: IOUMessage = {
amount,
comment,
currency,
IOUTransactionID: transactionID,
IOUReportID,
type,
whisperedTo: [CONST.IOU.RECEIPT_STATE.SCANREADY, CONST.IOU.RECEIPT_STATE.SCANNING].some((value) => value === receipt?.state) ? [currentUserAccountID ?? -1] : [],
};
but in ReportActionItem there's no checking happening when the transaction.receipt.state changes and scanning is successful (or not) to re-render ReportActionItem and reflect changes

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

in ReportActionItem we should subscribe to changes in Transaction.receipt.state in onyx so once the scanning is done we trigger the rendering of ReportActionItem using renderReportActionItem with a hook like useMemo to reflect changes in state

when scanning is done the whisperedTo in OriginlaMessage should be empty if report is not whispered to anyone specifically, otherwise include only people whispered to in the array
What alternative solutions did you explore? (Optional)
N/A

Copy link

melvin-bot bot commented Jun 18, 2024

📣 @M00rish! 📣
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>

@sobitneupane
Copy link
Contributor

Thanks for your proposal @M00rish

there's no checking happening when the transaction.receipt.state changes and scanning is successful (or not) to re-render ReportActionItem and reflect changes

I am not sure if that's the case as the issue can still be reproduced after the page re-renders.

Can you please include pseudocode on how you will implement the solution you suggested.

@M00rish
Copy link
Contributor

M00rish commented Jun 19, 2024

actually, the issue is no longer reproducible on staging... it seems to be fixed I guess.

@jliexpensify
Copy link
Contributor

Oh nice - @M00rish did you manage to grab a video?

Copy link

melvin-bot bot commented Jun 20, 2024

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

@M00rish
Copy link
Contributor

M00rish commented Jun 20, 2024

@jliexpensify not really if you still need it I might be able to make one tonight

Copy link

melvin-bot bot commented Jun 24, 2024

@sobitneupane, @jliexpensify Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@jliexpensify
Copy link
Contributor

@sobitneupane can you repro this any more? I can't seem to.

Copy link

melvin-bot bot commented Jun 26, 2024

@sobitneupane, @jliexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@sobitneupane
Copy link
Contributor

@jliexpensify I cannot reproduce the issue any longer.

Screen.Recording.2024-06-27.at.13.20.16.mov

@melvin-bot melvin-bot bot removed the Overdue label Jun 27, 2024
@jliexpensify
Copy link
Contributor

Ok, lets close this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants