App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Approver receives whisper when report is auto-approved on their behalf

Open garrettmknight opened this issue 1 year ago • 6 comments

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: N/A Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @garrettmknight Slack conversation (hyperlinked to channel name): None, yet

Action Performed:

  1. Create a new workspace in NewDot
  2. Invite a submitter to the workspace
  3. Enable Workflows
  4. In Workflows, enable Approvals
  5. In Workflows, enable Delay Submission
  6. Enable Rules
  7. Enable auto-approval
  8. Set 'Random report audit' to 0% to ensure auto-approval
  9. As the submitter, create and submit an expense

Expected Result:

The expense that was submitted should get auto-approved without notifying the approver.

Actual Result:

The expense was auto-approved, but still notified the approver that they needed to approver via our whisper that's intended to only send when a report is approved and forwarded.

Screenshot 2024-12-06 at 4 02 20 PM

Workaround:

Yeah, but it's annoying.

Platforms:

All

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021865064479090764280
  • Upwork Job ID: 1865064479090764280
  • Last Price Increase: 2024-12-06
Issue OwnerCurrent Issue Owner: @eh2077

garrettmknight avatar Dec 06 '24 16:12 garrettmknight

Triggered auto assignment to @zanyrenney (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[bot] avatar Dec 06 '24 16:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 06 '24 16:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 06 '24 16:12 melvin-bot[bot]

@garrettmknight This should be internal 👍

FitseTLT avatar Dec 06 '24 16:12 FitseTLT

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

melvin-bot[bot] avatar Dec 10 '24 09:12 melvin-bot[bot]

Yeah, I also agreed that this should be internal and should be fixed from backend.

@zanyrenney Can you help add a Hot Pick tag for this issue? Thanks

eh2077 avatar Dec 10 '24 11:12 eh2077

@zanyrenney, @eh2077 Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

Yeah, I also agreed that this should be internal and should be fixed from backend.

@zanyrenney Can you help add a Hot Pick tag for this issue? Thanks

@zanyrenney Friendly bump

eh2077 avatar Dec 16 '24 12:12 eh2077

I'll look into this. I've been working on some of this code lately, so it is right up my alley.

tgolen avatar Dec 17 '24 18:12 tgolen

@Beamanator @cristipaval I wanted to get your thoughts on this one, since I saw you were recently discussing this exact whisper in https://github.com/Expensify/Auth/pull/13193/files#r1846155170.

The problem for this particular bug report is that:

  1. The Auth command for SubmitReport is called first (here) which sends the whisper
  2. The Auth command for ApproveReport is called second (here) which auto-approves the report

Thus, there is no way for SubmitReport to know if the report has been auto-approved or not and the whisper will always get sent.

I cannot think of a very good way of fixing this, and I'm wondering if you have any ideas. About the only thing I can think of is to add some kind of check before calling SubmitReport to see if the report will get auto-approved, and if so, then pass a parameter down to SubmitReport to skip sending the whisper. This however feels like a chicken-and-egg situation because you can't know if it can be auto-approved until it is submitted.

tgolen avatar Dec 17 '24 19:12 tgolen

Yeahhhh so I see your point and was thinking that could potentially work (check if the report will get auto-approved in SubmitReport) - another solution which is definitely harder would be to make SubmitReport 1:1:1 - thennnn, in Auth we would know if the report is about to get auto-approved - and if not, we send the whisper to the submitter-to approver, if SO we send the whisper to the next approver

Beamanator avatar Dec 18 '24 16:12 Beamanator

Yeah, I briefly talked about this with Cristi last night and we had a few thoughts.

  • We agreed 1:1:1 would be the best option (requires a lot of work)
  • We could send the whisper from PHP (but this goes in the opposite direction of 1:1:1)
  • We could try to make the ApproveReport command find and delete the whisper that was created during SubmitReport (too much of a hack)

tgolen avatar Dec 18 '24 16:12 tgolen

Nice, yeah agreed on all points haha. I wonder if anyone already started working on making SubmitReport 1:1:1?

Beamanator avatar Dec 18 '24 19:12 Beamanator

OK, yes, it is being worked on in https://github.com/Expensify/Expensify/issues/451223. I am going to place this on HOLD until that is done, then we can come back and work on this.

If it is a problem in the meantime, I think the only thing we should consider is temporarily removing the whisper.

tgolen avatar Dec 18 '24 21:12 tgolen

Monthly Update

  • This is still on HOLD until https://github.com/Expensify/Expensify/issues/451223 is finished

Next Steps

  • Wait for that issue to be finished

ETA

  • None

tgolen avatar Jan 22 '25 16:01 tgolen

Monthly Update

  • Same

tgolen avatar Feb 24 '25 15:02 tgolen

Monthly Update

  • Same. This is still on HOLD until https://github.com/Expensify/Expensify/issues/451223 is finished

tgolen avatar Mar 31 '25 15:03 tgolen

Monthly Update

  • Same

tgolen avatar May 05 '25 21:05 tgolen

Monthly Update

  • Same

tgolen avatar Jun 09 '25 14:06 tgolen

Month Update

  • Same

tgolen avatar Jul 15 '25 14:07 tgolen

Assume same as above @tgolen ?

zanyrenney avatar Aug 19 '25 10:08 zanyrenney

Yep, still on HOLD for https://github.com/Expensify/Expensify/issues/451223

tgolen avatar Aug 19 '25 17:08 tgolen

Same

tgolen avatar Sep 22 '25 15:09 tgolen

Still on HOLD.

tgolen avatar Nov 03 '25 16:11 tgolen