Problem
When a Dynamic External Workflow approval fails (for example, someone tries to approve their own report and the API returns You cannot approve your own reports.), Auth writes a DEWAPPROVEFAILED report action and pushes it to every participant on the report. The App then surfaces the report in the LHN with a green dot for all of them — including people who are neither the report owner, the manager, nor the actor who triggered the failed approval.
Reported case: a user with only auditor/comment permissions on an expense report saw it pinned in their LHN with a GBR, while their next step still read "waiting for <approver> to approve". They had no action to take.
Root cause
In getReasonAndReportActionThatRequiresAttention in src/libs/ReportUtils.ts, the first check returns HAS_DEW_APPROVE_FAILED whenever the report statusNum is SUBMITTED and any non-deleted DEW_APPROVE_FAILED action exists on it. There is no check on the current user's relationship to the report.
That sets requiresAttention, which in SidebarUtils.shouldDisplayReportInLHN overrides a hidden notification preference and pins the row with a GBR.
The neighbouring paths are gated correctly, which is what makes this look like an oversight:
- the DEW submit-failed branch requires
isReportOwner
- the "Fix issue" next step requires
isCurrentUserTheApprover
Expected behavior
A failed DEW approval should only require attention from the user who can actually resolve it — the current approver (and arguably the report owner). Other participants should not get a GBR or a pinned LHN row.
Actual behavior
Every participant on the report gets the GBR and the pinned LHN row, with no matching next step telling them what to do.
Steps to reproduce
- Set up a workspace with a Dynamic External Workflow and several participants on an expense report.
- Submit the report, then have the submitter attempt to approve it themselves so the approval fails.
- Sign in as an unrelated participant (not owner, not manager, not the actor).
- The report appears in that user's LHN with a GBR, while their next step still shows "waiting for <approver> to approve".
Proposed fix
Gate the HAS_DEW_APPROVE_FAILED branch on the current user being the approver (or the report owner), matching how the DEW submit-failed branch and the "Fix issue" next step are already gated.
Reported in Slack.
Issue Owner
Current Issue Owner: @Krishna2323
Problem
When a Dynamic External Workflow approval fails (for example, someone tries to approve their own report and the API returns
You cannot approve your own reports.), Auth writes aDEWAPPROVEFAILEDreport action and pushes it to every participant on the report. The App then surfaces the report in the LHN with a green dot for all of them — including people who are neither the report owner, the manager, nor the actor who triggered the failed approval.Reported case: a user with only
auditor/commentpermissions on an expense report saw it pinned in their LHN with a GBR, while their next step still read "waiting for <approver> to approve". They had no action to take.Root cause
In
getReasonAndReportActionThatRequiresAttentionin src/libs/ReportUtils.ts, the first check returnsHAS_DEW_APPROVE_FAILEDwhenever the reportstatusNumisSUBMITTEDand any non-deletedDEW_APPROVE_FAILEDaction exists on it. There is no check on the current user's relationship to the report.That sets
requiresAttention, which inSidebarUtils.shouldDisplayReportInLHNoverrides a hidden notification preference and pins the row with a GBR.The neighbouring paths are gated correctly, which is what makes this look like an oversight:
isReportOwnerisCurrentUserTheApproverExpected behavior
A failed DEW approval should only require attention from the user who can actually resolve it — the current approver (and arguably the report owner). Other participants should not get a GBR or a pinned LHN row.
Actual behavior
Every participant on the report gets the GBR and the pinned LHN row, with no matching next step telling them what to do.
Steps to reproduce
Proposed fix
Gate the
HAS_DEW_APPROVE_FAILEDbranch on the current user being the approver (or the report owner), matching how the DEW submit-failed branch and the "Fix issue" next step are already gated.Reported in Slack.
Issue Owner
Current Issue Owner: @Krishna2323