[$250] Approver receives whisper when report is auto-approved on their behalf
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:
- Create a new workspace in NewDot
- Invite a submitter to the workspace
- Enable Workflows
- In Workflows, enable Approvals
- In Workflows, enable Delay Submission
- Enable Rules
- Enable auto-approval
- Set 'Random report audit' to 0% to ensure auto-approval
- 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.
Workaround:
Yeah, but it's annoying.
Platforms:
All
Screenshots/Videos
Add any screenshot/video evidence
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 Owner
Current Issue Owner: @eh2077
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.
Job added to Upwork: https://www.upwork.com/jobs/~021865064479090764280
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)
@garrettmknight This should be internal 👍
@zanyrenney, @eh2077 Whoops! This issue is 2 days overdue. Let's get this updated quick!
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, @eh2077 Eep! 4 days overdue now. Issues have feelings too...
Yeah, I also agreed that this should be internal and should be fixed from backend.
@zanyrenney Can you help add a
Hot Picktag for this issue? Thanks
@zanyrenney Friendly bump
I'll look into this. I've been working on some of this code lately, so it is right up my alley.
@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:
- The Auth command for
SubmitReportis called first (here) which sends the whisper - The Auth command for
ApproveReportis 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.
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
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
ApproveReportcommand find and delete the whisper that was created duringSubmitReport(too much of a hack)
Nice, yeah agreed on all points haha. I wonder if anyone already started working on making SubmitReport 1:1:1?
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.
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
Monthly Update
- Same
Monthly Update
- Same. This is still on HOLD until https://github.com/Expensify/Expensify/issues/451223 is finished
Monthly Update
- Same
Monthly Update
- Same
Month Update
- Same
Assume same as above @tgolen ?
Yep, still on HOLD for https://github.com/Expensify/Expensify/issues/451223
Same
Still on HOLD.