Skip to content

[CP staging] Revert "Allow any workspace admin to pay reports" - #100354

Merged
chuckdries merged 2 commits into
mainfrom
revert-95925-fix/95750
Sep 4, 2026
Merged

[CP staging] Revert "Allow any workspace admin to pay reports"#100354
chuckdries merged 2 commits into
mainfrom
revert-95925-fix/95750

Conversation

@chuckdries

@chuckdries chuckdries commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Straight revert* of #95925 while we investigate #100353

*There was a legitimate eslint failure that previously existed in main, but was ignored by seatbelt. After this PR merged, osbotify tightened the seatbelt. Rather than revert the osbotify commit and re-allow the lint failure, I pushed this type-only change to fix it.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@chuckdries
chuckdries requested review from a team as code owners September 3, 2026 20:04
@melvin-bot
melvin-bot Bot requested review from arosiclair and trjExpensify and removed request for a team September 3, 2026 20:04
@melvin-bot

melvin-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

@arosiclair Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team September 3, 2026 20:04
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/components/SettlementButton/index.tsx 74.39% <ø> (-0.37%) ⬇️
src/hooks/useSearchBulkActions.ts 71.24% <100.00%> (ø)
src/libs/PaymentUtils.ts 79.79% <100.00%> (-0.98%) ⬇️
src/libs/PolicyUtils.ts 79.63% <ø> (-0.35%) ⬇️
src/libs/ReportNameUtils.ts 81.30% <100.00%> (-0.05%) ⬇️
src/libs/ReportPreviewActionUtils.ts 91.66% <100.00%> (+0.21%) ⬆️
src/libs/ReportPrimaryActionUtils.ts 94.23% <100.00%> (+0.09%) ⬆️
src/libs/ReportUtils.ts 87.24% <100.00%> (-0.06%) ⬇️
src/libs/actions/BankAccounts.ts 24.23% <ø> (-0.86%) ⬇️
src/libs/actions/IOU/PayMoneyRequest.ts 81.99% <ø> (-0.17%) ⬇️
... and 7 more
... and 20 files with indirect coverage changes

@chuckdries

Copy link
Copy Markdown
Contributor Author

Weird - it's a straight revert, but the lint failure is legitimate. It's just a problem with a type annotation, so I'm going to fix it.

@arosiclair

Copy link
Copy Markdown
Contributor

@chuckdries all yours if you really want to revert

@chuckdries
chuckdries merged commit 0520138 into main Sep 4, 2026
44 of 45 checks passed
@chuckdries
chuckdries deleted the revert-95925-fix/95750 branch September 4, 2026 15:53
@OSBotify

OSBotify commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚧 chuckdries has triggered a test Expensify/App build. You can view the workflow run here.

@chuckdries chuckdries changed the title Revert "Allow any workspace admin to pay reports" [CP staging] Revert "Allow any workspace admin to pay reports" Sep 4, 2026
OSBotify pushed a commit that referenced this pull request Sep 4, 2026
Revert "Allow any workspace admin to pay reports"

(cherry picked from commit 0520138)

(cherry-picked to staging by AndrewGable)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Sep 4, 2026
@os-botify

os-botify Bot commented Sep 4, 2026

Copy link
Copy Markdown

🔁 Filed a Staging retest request for deploy blockers #100353 after this PR was cherry-picked to staging.

@OSBotify

OSBotify commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 9.4.72-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Yes — one help site article needs a change. Draft PR: #100416

Why

This PR reverts "Allow any workspace admin to pay reports" (#95925). That feature never reached production and the help site was never updated for it, so nothing needs un-documenting.

But the revert re-exposes a stale sentence that was already on the help site. docs/articles/new-expensify/workspaces/Workspace-Workflows.md:102 says:

Only the authorized payer is prompted to pay reports. […] Other admins can still open a report and pay it.

That last clause was written in July 2026 for workspaces reimbursing outside Expensify, but it sits under its own ## What happens after you set an authorized payer heading, so it reads as a blanket rule. Post-revert it is wrong for workspaces with a business bank account connected — there, only the authorized payer sees Pay. That's exactly the confusion behind #100353, where a second admin tried to pay and got an error.

Code backing the behavior

A non-payer admin only gets Pay when reimbursementChoice is REIMBURSEMENT_MANUAL:

With a business bank account connected (REIMBURSEMENT_YES) and a Payer set, isPolicyPayer returns true only for the designated payer.

I also checked every other article that mentions paying — Pay-Expenses.md, Reimbursement-Payment-Methods.md, Expense-and-Report-Actions.md, Reimburse-Reports.md — and none of them make a claim about which admin can pay. Only this one article needed touching.

What the draft PR changes

  1. Splits the "other admins" sentence into the two cases the code distinguishes: no bank account connected (other admins can record it with Mark as paid) vs. bank account connected (only the authorized payer can pay).
  2. Adds a line saying that changing the Payer is how you let a different admin pay from the connected bank account.
  3. Drive-by: corrects two UI labels in the same article that were already wrong — Connect Bank AccountAdd bank account, and Mark as PaidMark as paid. Happy to split these out if you'd rather keep the PR to item 1–2.

Labels verified against the live UI

I drove the web app to confirm exact capitalization rather than writing from memory. Confirmed: Workflows, Payments, Payer, and Add bank account (not "Connect bank account"). Mark as paid matches src/languages/en.ts:1540.

Workflows page Payments section showing Add bank account button and Payer row


@chuckdries, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@OSBotify

OSBotify commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.72-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@OSBotify

OSBotify commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 9.4.73-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@MelvinBot

MelvinBot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Yes — one help site change is required, and two open docs PRs are now stale.

Draft PR: #100492Docs updates for E/A#100354 scope who can pay reports besides payer (HelpDot, assigned to chuckdries)

What needed fixing. Workspace-Workflows.md:102 ends the What happens after you set an authorized payer section with a flat, unscoped sentence: "Other admins can still open a report and pay it." That heading isn't scoped to the no-bank-account case, so an admin on a workspace with a connected bank account reads it and expects a Pay button they'll never see. #100353 is that confusion turning into an error. The PR replaces the sentence with the two real cases the reverted code enforces:

  • No bank account connected (manual reimbursement) — other Workspace Admins can open an approved report, click Pay, and select Mark as paid.
  • Bank account connected (ACH) — only the authorized payer, plus Workspace Admins the business bank account has been shared with, can pay.

⚠️ Two open draft docs PRs document the pre-revert behavior and should not merge as written: #100364 and #100349 both add copy saying any Workspace Admin can pay regardless of the Payer setting. Since #95925 is reverted, that copy is now wrong. Recommend closing or holding both until the feature relands.

Evidence and what I checked

Post-revert gating, read off this PR's head:

  • src/libs/ReportPrimaryActionUtils.ts:235-240 — the non-payer admin pay path survives the revert but is narrowed back to reimbursementChoice === REIMBURSEMENT_MANUAL plus canMemberWrite(WORKFLOWS_PAYMENTS). The removed canAdminPayReport helper had covered REIMBURSEMENT_YES too.
  • src/libs/ReportUtils.ts:3008-3017 — for auto reimbursement isPayer returns isReimburser || (isAdmin && hasAccessToBankAccount), where access means the admin is listed in the bank account's sharees. For manual reimbursement it returns reimburser-only.

Docs I checked and left alone:

  • Pay-Expenses.md — makes no who-can-pay claim on main, so nothing to correct.
  • Expense-and-Report-Actions.md — "you are a payer" is still accurate post-revert.
  • Expensify Classic articles — unaffected; Classic already showed pay to any admin and this revert is NewDot-only.

UI labels verified in the live app, not from memory: the Workflows page shows a Payments section (helper text "Add an authorized payer for payments made in Expensify or track payments made elsewhere.") and a Payer row whose picker screen is headed Authorized payer. An approved report's Pay button offers Pay with business account and Mark as paid.

Applied docs/HELPSITE_NAMING_CONVENTIONS.md, docs/HELP_AUTHORING_GUIDELINES.md, and docs/TEMPLATE.md: existing task-based heading kept, only ## sections, bolded UI-exact labels, and a single relative cross-link placed outside the numbered steps.


@chuckdries, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run · no recording available

@OSBotify

OSBotify commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.73-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants