Skip to content

Part 2 - Fix review workspace settings onboarding task completion - #101125

Merged
robertjchen merged 15 commits into
Expensify:mainfrom
FitseTLT:fix-review-workspace-settings-update-part-2
Oct 6, 2026
Merged

robertjchen merged 15 commits into
Expensify:mainfrom
FitseTLT:fix-review-workspace-settings-update-part-2

Conversation

@FitseTLT

@FitseTLT FitseTLT commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

The "Review your workspace settings" Concierge onboarding task only auto-completes when the backend finishes it as a side effect of specific workspace-setting API writes (per the report action types the backend engineer confirmed). Part 1 wired the client-side optimistic mirroring for 10 of those commands; several other settings the backend also completes were still missing this wiring, so the task either didn't check off until a later reload or, for one page, never did because the reachable UI called a different, unwired function than the one that actually had the logic.

This PR extends the same useReviewWorkspaceSettingsTaskCompletion optimistic-mirroring pattern to the remaining backend-confirmed commands: the auto-approve and auto-pay toggles and their amount/audit-rate fields, prevent self-approval, require tag, require category, and submission frequency (auto-harvesting), plus a fix for the itemized-receipt-required amount (the wiring existed only on an orphaned page nothing links to; the actual "Receipt requirements" page was missing it). Settings confirmed via live reload testing to not be completed by the backend (approval mode, prohibited-expense defaults, reimbursement/payer, distance-rate settings, address, avatar) were left unwired.

Fixed Issues

$ #67648
PROPOSAL:

Tests

Precondition: sign in with an account onboarded as newDotAdmin (invited to a workspace as an admin) so the "Review your workspace settings" task exists in the onboarding/Concierge chat.

For each setting below: change it and Save, verify the task is checked, then reload the app and verify it remains checked.

  1. Workflows tab → toggle "Auto-approve compliant reports" ON.
  2. Workflows tab → "Auto-approve reports under" → set an amount.
  3. Workflows tab → "Randomly audit reports" rate → change the percentage.
  4. Workflows tab → toggle "Auto-pay approved reports" ON.
  5. Workflows tab → "Auto-pay reports under" → set an amount.
  6. Workflows tab → Submissions → change "Submissions" frequency (auto-harvesting).
  7. Workflows tab -> Advanced → toggle "Prevent self approval" ON.
  8. Rules tab → Require fields → toggle "Require category".
  9. Rules tab → Require fields → toggle "Require tag" (single-level tag list).
  10. Rules tab → Receipt requirements → set an "Itemized receipt required" amount.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

Same as tests

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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
2026-09-15.20-30-05.mp4

@FitseTLT
FitseTLT requested review from a team as code owners September 14, 2026 19:59
@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and situchan and removed request for a team and joekaufmanexpensify September 14, 2026 19:59
@melvin-bot

melvin-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

@situchan 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 14, 2026 19:59
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/actions/Policy/Category.ts 48.95% <100.00%> (+0.26%) ⬆️
src/libs/actions/Policy/Tag.ts 68.35% <100.00%> (+0.19%) ⬆️
src/libs/actions/Task.ts 66.07% <100.00%> (+0.50%) ⬆️
...ages/workspace/rules/ExpenseReportRulesSection.tsx 93.54% <100.00%> (+0.07%) ⬆️
...pages/workspace/rules/RulesRequireReceiptsPage.tsx 97.75% <100.00%> (+0.07%) ⬆️
...c/pages/workspace/upgrade/WorkspaceUpgradePage.tsx 61.26% <ø> (ø)
...rkspace/rules/RulesAutoApproveReportsUnderPage.tsx 0.00% <0.00%> (ø)
...e/rules/RulesItemizedReceiptRequiredAmountPage.tsx 0.00% <0.00%> (ø)
...ges/workspace/rules/RulesRandomReportAuditPage.tsx 0.00% <0.00%> (ø)
...rkspace/workflows/tabs/WorkflowsSubmissionsTab.tsx 0.00% <0.00%> (ø)
... and 3 more
... and 10 files with indirect coverage changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c788c27922

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/actions/Policy/Policy.ts Resolved
Comment thread src/libs/actions/Policy/Policy.ts Resolved
@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Code review — 1 blocker, 2 questions. Reviewed the diff against a4ed736; I did not run the flow live (reaching the newDotAdmin Concierge task needs a seeded invited-admin account).

🔴 Blocker: duplicate task completion when both receipt amounts change in one save

RulesRequireReceiptsPage.tsx:135-137 — updateReceipt and updateItemized each call getReviewWorkspaceSettingsTaskCompletion(). The getter mints a fresh optimistic reportActionID on every call (useReviewWorkspaceSettingsTaskCompletion.ts:18 → Task.ts:526).

In the receiptChanged && itemizedChanged branch both closures run in the same tick, before Onyx applies the first optimistic stateNum: APPROVED — so the "task already complete → return {}" guard in getFinishOnboardingTaskOnyxData never fires.

Repro: Rules → Receipt requirements → change both "Receipt required" and "Itemized receipt required" amounts → Save.

Result: two distinct TASK_COMPLETED actions merged into reportActions_<taskReportID> (two "marked as complete" entries in the task thread), plus two backend commands each carrying a different completedTaskReportActionID. If only one request fails, its failureData reopens the task while the other's completion sticks.

This is the exact case you guarded in RulesRequireFieldsPage.tsx:139-147. Same fix: build it once, give it to whichever request is sent first, pass {} to the other.

Questions

  1. Multi-level tag lists are unwired. hasTagLevelChanges routes to setPolicyTagLevelsRequired → SET_POLICY_TAGS_REQUIRED, which got no wiring. Does the backend complete the task on that command too? If so, workspaces with multi-level tags still won't tick until reload — the bug this PR is fixing.

  2. Other callers of the newly-wired commands are also unwired: WorkspaceUpgradePage.tsx:237-243 (fires three of them back to back) and WorkspaceMemberDetailsPage.tsx:224. Deliberately out of scope? Worth a line in the PR description either way — and note WorkspaceUpgradePage would triple-fire the blocker above the moment someone wires it, which is why the guard may belong in the hook rather than at each call site.

Nits and things that checked out
  • RulesRequireFieldsPage.tsx:141 calls the getter unconditionally, minting a reportActionID even on a multi-level-tag-only save where nothing consumes it. Harmless, just dead work.
  • No new tests. The "only one call carries the task data" invariant is exactly what regresses silently — worth locking in next to the updated RulesRequireReceiptsPageTest assertions, which is also what Codecov is flagging.
  • Moving withReviewWorkspaceSettingsTaskData from Policy.ts to Task.ts:644 is the right home, and it correctly preserves finallyData via the spread.
  • Dropping the OnyxKey type import from Policy.ts is safe — the only remaining match is the local UpgradeSubmitOnyxKey alias.
  • The early-return guards (setPolicyPreventSelfApproval, enableAutoApprovalOptions, enablePolicyAutoReimbursementLimit) discard the task data on a no-op change rather than leaking a completion. Correct.
  • New completedTaskReportActionID?: string fields are all optional, so no breakage for the unwired callers.

Next Steps: Reply with @MelvinBot <your feedback> to refine this review.

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Code quality review (a4ed736). The logic is sound — this is all about the shape of the wiring. One structural suggestion, then nits.

The wiring is three separate edits that must always happen together

Adding a command to this feature means doing all three of these, in three different places:

  1. add completedTaskReportActionID?: string to the params type
  2. splice completedTaskReportActionID: reviewWorkspaceSettingsTaskData.completedTaskReportActionID into parameters
  3. wrap the onyxData in withReviewWorkspaceSettingsTaskData(...)

Nothing enforces the set. Do 2 without 3 and the backend ticks the task while the client shows nothing until reload — the exact bug this PR fixes, reintroduced silently. Do 3 without 2 and the backend mints its own second completion action. Both failure modes are invisible at review time because each half looks correct on its own. This PR is Part 2 and it's already 21 threaded params and 20 copies of the same param-type comment; there will be a Part 3.

Collapsing steps 2 and 3 into one call at the API.write boundary makes the pair atomic:

// Task.ts, next to withReviewWorkspaceSettingsTaskData
function writeWithReviewWorkspaceSettingsTask(command, parameters, onyxData, taskData: OnboardingTaskCompletionOnyxData) {
    API.write(command, {...parameters, completedTaskReportActionID: taskData.completedTaskReportActionID}, withReviewWorkspaceSettingsTaskData(onyxData, taskData));
}

Each action then goes from three edits to one line, and the half-wired states stop being expressible. (API.write's command→params generic coupling will need some care here — I'm suggesting the direction, not a drop-in.)

Same idea for step 1: that JSDoc line is now byte-identical in 20 files under src/libs/API/parameters/. One shared type kills all 20 copies — type SetPolicyRequiresTag = {policyID: string; requiresTag: boolean} & ReviewWorkspaceSettingsTaskParams;. (CONSISTENCY-3)

Worth fixing in this PR

Positional-argument creep. enableAutoApprovalOptions is now six positional params, four of them X | undefined. The call site had to reformat to eight lines of bare values where nothing tells you what policy?.autoApproval?.limit is doing in slot 4. Three other call sites took the same hit. If the trailing optional became part of an options object, these stay one-liners and the new argument is self-labelling.

Mutation-as-a-flag. RulesRequireFieldsPage.tsx:139-147 uses let plus a reassignment to {} to mean "already consumed." The reader has to carry that state across the intervening branch. Expressing the rule where it's applied is clearer and drops the let:

setPolicyRequiresTag(policyData, tagRequired, categoryUpdateForTagRecompute, hasCategoryChange ? {} : reviewWorkspaceSettingsTaskData);

No new tests. The only test change is absorbing the new argument into six existing toHaveBeenCalledWith assertions. The "exactly one call carries the task data" invariant — the thing this PR reasons hardest about, and the thing a future edit will quietly break — has no coverage. One test asserting the tag call receives {} when the category call took the data would lock it in.

Nits

  • New type imports were appended to the end of alphabetically-sorted lists instead of inserted in order: Category.ts:23, Tag.ts:19, Policy.ts:59.
  • SetPolicyRequiresTag and SetPolicyExpenseMaxAmountNoItemizedReceipt are missing the Params suffix every sibling in those same import lists has. Pre-existing names, but this PR is what puts them on a type annotation — cheap to rename while you're here.
  • useReviewWorkspaceSettingsTaskCompletion.ts:18 returns a bare arrow with no memoization, and RulesRequireReceiptsPage.tsx:172 lists it in a useCallback dep array. If that hook file isn't React-Compiler-compiled, the identity changes every render and the useCallback never caches. I couldn't run react-compiler-compliance-check here to confirm which way it falls — worth a check now that this PR adds six more consumers.
Things that read well
  • withReviewWorkspaceSettingsTaskData belongs in Task.ts, not Policy.ts — good move, and the spread correctly preserves finallyData.
  • The comments explain why rather than what — the "only one of the two calls should carry this" note and the docstring on completeTask about shouldSendCompleteTaskRequest both earn their place.
  • Defaulting the new param to {} instead of making it required keeps the ~12 unwired call sites untouched. Right call for a Part-2 PR.
  • Narrowing the untyped const parameters = {...} literals to their real Params types in Category.ts, Tag.ts, and setPolicyMaxExpenseAmountNoItemizedReceipt is a genuine improvement over what was there.

Next Steps: Reply with @MelvinBot <your feedback> to refine this review.

@FitseTLT

Copy link
Copy Markdown
Contributor Author

waiting for review

@FitseTLT

Copy link
Copy Markdown
Contributor Author

@situchan for review

@situchan

Copy link
Copy Markdown
Contributor

Reviewing shortly. tests still failing

@situchan

Copy link
Copy Markdown
Contributor

Author checklist is also not complete

@FitseTLT

Copy link
Copy Markdown
Contributor Author

Fixed @situchan

@situchan

situchan commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
1.mov
2.3.mov
4.5.mov
6.mov
7.mov
8.9.mov
10.mov

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Re-review at f350dff: the duplicate-completion blocker is fixed. One blocker remains: the stale .github bundles. I reviewed the code only and did not run the flow live.

🔴 Blocker: revert the .github/actions bundles

The PR still changes isDeployChecklistLocked/index.js and proposalPoliceComment/index.js (+29/−128 each). These are stale builds made from an older expensify-common. Merging them would remove code that main has, such as the UPDATE_PERSONAL_DETAILS constants and the ExpensiMark TLD logic. They also cause the failing Validate Github Actions / verify check ("Diff found when Github Actions were rebuilt"). situchan asked for the same revert.

Fix:

git checkout origin/main -- .github/actions/javascript/isDeployChecklistLocked/index.js .github/actions/javascript/proposalPoliceComment/index.js

✅ Fixed since the last review

Still open

  1. One "require category" path is unwired. The "Enable categories to require them" confirm path at RulesRequireFieldsPage.tsx:244 still calls setWorkspaceRequiresCategory without task data. On that path, the task won't tick until reload, which is the bug this PR fixes. Pass getReviewWorkspaceSettingsTaskCompletion() there.
  2. Multi-level tags (unanswered from last round). SET_POLICY_TAGS_REQUIRED is still unwired. Does the backend complete the task on it? If yes, workspaces with multi-level tags keep the bug.
  3. No test for the "one request carries the task data" rule. Every updated assertion expects {}, because the tests have no onboarding task. A regression to double completion would still pass. Add one test that seeds the task, changes both amounts, and checks that only the first call gets a non-empty completedTaskReportActionID.
Nits (carried over, optional)
  • RulesRequireFieldsPage.tsx:144 builds the task data even on a save that changes only multi-level tags, where nothing uses it.
  • New type imports are added at the end of sorted import lists in Category.ts, Tag.ts, and Policy.ts, instead of in alphabetical order.
  • WorkspaceMemberDetailsPage.tsx:230 turns off self-approval as a side effect of removing a member. Leaving it unwired seems right, since the admin didn't change the setting on purpose.

Next Steps: Reply with @MelvinBot <your feedback> to refine this review.


view run

@FitseTLT

FitseTLT commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Done

@situchan

situchan commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Test step 7 is wrong. It's under Workflows tab

@situchan

situchan commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

While testing 8 and 9, I noticed "marked as complete" message twice (one for optimistic, one from server).
Optimistic one disappears after clear cache and restart

8.9.mov

Are you able to reproduce?

@FitseTLT

FitseTLT commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Couldn't reproduce

2026-10-05.15-05-09.mp4

@situchan

situchan commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

I'd consider below findings not blocker.

1. Upgrade path doesn't send the task data

WorkspaceUpgradePage.tsx:240-246

ExpenseReportRulesSection bails to the upgrade page whenever the toggle is turned on for a non-Control workspace, so on Collect/Team the three newly-wired toggles are actually applied by confirmUpgrade, which calls setPolicyPreventSelfApproval / enableAutoApprovalOptions / enablePolicyAutoReimbursementLimit without the task data. The page already has the getter in scope for setPolicyPreventMemberCreatedTitle.

  1. On a Collect workspace, open Workspace → Workflows/Rules.
  2. Turn "Prevent self approval" on (repeat with "Auto-approve compliant reports" and "Auto-pay approved reports").
  3. The upgrade page opens; confirm the upgrade.
  4. The setting is applied, but the task stays unchecked.
  5. Reload the app — the task is now checked.

This is edge case because upgrade only works when online

2. Multi-level tag workspaces don't send it

RulesRequireFieldsPage.tsx:152-159

The task data is only forwarded on the hasSingleTagChange branch. The setPolicyTagLevelsRequired branch discards it, so the same "Require tag" toggle ticks the task on single-level tag workspaces but not multi-level ones.

  1. Use a workspace with two or more tag levels.
  2. Open Workspace → Rules → Require fields.
  3. Turn "Require tag" on for one level (leave "Require category" untouched) and Save.
  4. The task stays unchecked.
  5. Reload the app — the task is now checked.

Looks like out of scope as per

  1. Rules tab → Require fields → toggle "Require tag" (single-level tag list).

3. The locked-category prompt doesn't send it

RulesRequireFieldsPage.tsx:244

promptEnableCategoriesForRequireCategory calls setWorkspaceRequiresCategory(policyData, true, isVendorMatchingBetaEnabled) with no task data, so reaching requiresCategory: true through the locked-row prompt doesn't tick the task, while the Save button does.

  1. Use a workspace with the Categories feature turned off.
  2. Open Workspace → Rules → Require fields and tap the disabled "Require category" row.
  3. Confirm "enable categories and require".
  4. requiresCategory is set, but the task stays unchecked.
  5. Reload the app — the task is now checked.

@melvin-bot
melvin-bot Bot requested a review from robertjchen October 5, 2026 12:12
@FitseTLT

FitseTLT commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

I'd consider below findings not blocker.

1. Upgrade path doesn't send the task data

WorkspaceUpgradePage.tsx:240-246

ExpenseReportRulesSection bails to the upgrade page whenever the toggle is turned on for a non-Control workspace, so on Collect/Team the three newly-wired toggles are actually applied by confirmUpgrade, which calls setPolicyPreventSelfApproval / enableAutoApprovalOptions / enablePolicyAutoReimbursementLimit without the task data. The page already has the getter in scope for setPolicyPreventMemberCreatedTitle.

  1. On a Collect workspace, open Workspace → Workflows/Rules.
  2. Turn "Prevent self approval" on (repeat with "Auto-approve compliant reports" and "Auto-pay approved reports").
  3. The upgrade page opens; confirm the upgrade.
  4. The setting is applied, but the task stays unchecked.
  5. Reload the app — the task is now checked.

This is edge case because upgrade only works when online

My changes cover it.

2. Multi-level tag workspaces don't send it

RulesRequireFieldsPage.tsx:152-159

The task data is only forwarded on the hasSingleTagChange branch. The setPolicyTagLevelsRequired branch discards it, so the same "Require tag" toggle ticks the task on single-level tag workspaces but not multi-level ones.

  1. Use a workspace with two or more tag levels.
  2. Open Workspace → Rules → Require fields.
  3. Turn "Require tag" on for one level (leave "Require category" untouched) and Save.
  4. The task stays unchecked.
  5. Reload the app — the task is now checked.

Looks like out of scope as per

  1. Rules tab → Require fields → toggle "Require tag" (single-level tag list).

The BE too doesn't complete it.

3. The locked-category prompt doesn't send it

RulesRequireFieldsPage.tsx:244

promptEnableCategoriesForRequireCategory calls setWorkspaceRequiresCategory(policyData, true, isVendorMatchingBetaEnabled) with no task data, so reaching requiresCategory: true through the locked-row prompt doesn't tick the task, while the Save button does.

  1. Use a workspace with the Categories feature turned off.
  2. Open Workspace → Rules → Require fields and tap the disabled "Require category" row.
  3. Confirm "enable categories and require".
  4. requiresCategory is set, but the task stays unchecked.
  5. Reload the app — the task is now checked.

The BE too doesn't complete it.

@robertjchen robertjchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, let's try this out! 🤞

@robertjchen
robertjchen merged commit 3b78e26 into Expensify:main Oct 6, 2026
35 of 37 checks passed
@OSBotify

OSBotify commented Oct 6, 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 Oct 6, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Oct 6, 2026
100 tasks done
@OSBotify

OSBotify commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/robertjchen in version: 9.5.4-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update is needed. This PR fixes a bug so the "Review your workspace settings" onboarding task checks off right after you change a workspace setting, and no article under docs/articles describes when that task completes.


view run

@OSBotify

OSBotify commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants