App icon indicating copy to clipboard operation
App copied to clipboard

Reports stay individually GBR'd for former approver when they're restored as approver

Open garrettmknight opened this issue 1 month ago β€’ 17 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 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 Expensify/Expensify Issue URL: Issue reported by: @garrettmknight Slack conversation (hyperlinked to channel name): N/A

Action Performed:

  1. Create a workspace
  2. Invite 3 members Submitter + Approver A + Approver B
  3. Set Approver A as the approver for the whole workspace
  4. As Submitter, create and submit two separate expense reports with one expense each + submit the reports
  5. As Approver A, navigate to Submitter's expense chat
  6. As Admin, change the workspace approver to Approver B
  7. Verify that in Approver A's view, they're rerouted to Concierge and the two outstanding reports populate with GBR in their LHN.
  8. As Admin, change the workspace approver back to Approver A.

Expected Result:

  • The individual GBR'd reports in LHN should disappear.
  • Submitter's expense chat should reappear and GBR

Actual Result:

  • Individaul GBR'd reports remain until they are viewed by the approver, at which point they're removed from LHN
  • Submitter's expense chat only reappears and GBRs after accessing one of the individual GBR'd reports

Workaround:

The user can still access the reports to approve, it's just confusing.

Platforms:

Select the officially supported platforms where the issue was reproduced: ALL

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

garrettmknight avatar Dec 01 '25 17:12 garrettmknight

Triggered auto assignment to @greg-schroeder (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 01 '25 17:12 melvin-bot[bot]

Taking over since I'm familiar with it. @Beamanator here's a vid:

https://github.com/user-attachments/assets/88e0d3bc-5feb-4ae7-873a-14a336e885dd

garrettmknight avatar Dec 01 '25 17:12 garrettmknight

Love it - the setup steps & video make this super clear and straightforward, time to look for a backend contrib to help finish this off πŸ‘

Beamanator avatar Dec 03 '25 12:12 Beamanator

Posted: https://expensify.slack.com/archives/C086VHWPPUM/p1764763471487099

Beamanator avatar Dec 03 '25 12:12 Beamanator

Root Cause

When policy chat reports are reshared with default approvers (e.g., after changing the default approver), hasParentAccess and hasOutstandingChildRequest weren't updated in Onyx until OpenReport was called. This caused incorrect "requires attention" states on the frontend.

Solution

Added logic in queueShareReportOnyxUpdates() to compute these fields when sharing:

  • If the parent report is being shared in the current batch, set hasParentAccess = true directly
  • compute the actual value of hasOutstandingChildRequest using hasOutstandingChildRequest()

DRAFT PR -> https://github.com/Expensify/Auth/pull/18544

ishpaul777 avatar Dec 03 '25 19:12 ishpaul777

@garrettmknight should we also consider this case for advanced approval policies?

Beamanator avatar Dec 04 '25 13:12 Beamanator

Yeah, I think it originally came from that, but we can repro with simple approvals too.

garrettmknight avatar Dec 05 '25 12:12 garrettmknight

Merged the fix for simple approvers, @ishpaul777 can you also make sure the advanced approvals case works here before we get a retest? The OP has test steps for advanced approval πŸ‘

Beamanator avatar Dec 08 '25 09:12 Beamanator

works well! πŸŽ‰

Simple Approval

https://github.com/user-attachments/assets/65e501c3-ea4f-4485-9186-7cc51b01b313

Advanced (multi-step approval)

https://github.com/user-attachments/assets/a168669a-1da0-407f-9b09-a441f6e33f87

ishpaul777 avatar Dec 08 '25 12:12 ishpaul777

Ooh that is looking great!! We could close this out, OR should we make sure every conceivable flow change is working? Ex: category & tag approval changes

Beamanator avatar Dec 08 '25 12:12 Beamanator

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

melvin-bot[bot] avatar Dec 12 '25 00:12 melvin-bot[bot]

@garrettmknight when you have a moment could you check if GBR is working well when category / tag approvers are updated? I can't quite remember where we left that so we may need to revisit - or are we good to close this out?

FYI I'm OOO a few days next week

Beamanator avatar Dec 12 '25 09:12 Beamanator

@garrettmknight @Beamanator @ishpaul777 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Dec 15 '25 21:12 melvin-bot[bot]

@garrettmknight can you please help with next steps here, Thanks!

ishpaul777 avatar Dec 15 '25 22:12 ishpaul777

Quick bump whenever you have time @garrettmknight πŸ™

Beamanator avatar Dec 18 '25 20:12 Beamanator

@garrettmknight, @Beamanator, @ishpaul777 Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Dec 23 '25 23:12 melvin-bot[bot]

not overdue

ishpaul777 avatar Dec 25 '25 14:12 ishpaul777

not overdue, still waiting for g-money to have time after holidays πŸ™

Beamanator avatar Dec 29 '25 19:12 Beamanator

no updates still waiting

ishpaul777 avatar Jan 01 '26 21:01 ishpaul777