Skip to content

Go straight to the Concierge step when copying workspace settings offline - #103812

Merged
Julesssss merged 4 commits into
mainfrom
claude-copySettingsOfflineConciergeStep
Oct 13, 2026
Merged

Julesssss merged 4 commits into
mainfrom
claude-copySettingsOfflineConciergeStep

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

When you copy workspace settings while offline, the CopyPolicySettings request is only queued. The "Copy in progress..." modal waits for the server to set nvp_bulkPolicyCopySettings to complete or failed, which can't happen offline, so the spinner loaded indefinitely.

Following Design's direction on the issue, an offline copy now goes straight to the "Concierge will let you know" step:

  • CopyPolicySettingsConfirmPage passes isOffline from useNetwork() to copyPolicySettings.
  • buildCopyPolicySettingsData sets the optimistic currentStep to complete when offline. Online, it stays loading.
  • copyPolicySettings queues CopyPolicySettings_Notify right after the copy request when offline. This is what "Let me know when it's done" already does, and the sequential queue sends it after the copy request once you reconnect.

Online behavior, the optimistic target-workspace updates, and failureData are unchanged.

Fixed Issues

$ #103297
PROPOSAL: #103297 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.

  • Verify that no errors appear in the JS console

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 verified any copy / text that was added to the app 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 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 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

…line

Offline, the CopyPolicySettings request is only queued, so the progress modal's spinner could never finish. Open the modal on the Concierge notification step instead and queue CopyPolicySettings_Notify after the copy, the same as choosing "Let me know when it's done".

Co-authored-by: Qichen Zhu <QichenZhu@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 12, 2026 23:25
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 12, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-copySettingsOfflineConciergeStep
git checkout -b claude-copySettingsOfflineConciergeStep upstream/claude-copySettingsOfflineConciergeStep
git push -u origin claude-copySettingsOfflineConciergeStep

Then you can close this PR and open a new one from your fork.

@MelvinBot

MelvinBot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

Copying settings while offline now goes straight to "Concierge will let you know" instead of getting stuck on the "Copy in progress..." spinner. Dismiss closes the modal, the copy syncs once you're back online, and the online flow still shows "Copy in progress..." and then "All Set!".
Online copy resolved to All Set state

Step Status
WS A has Rules enabled with a merchant rule, and WS C exists with Rules offWS A (Control) Rules > Expense defaults > Merchants shows 'Merchant is "Starbucks" -> Update category to "Advertising"'. WS C (Control) has the Rules toggle off in More features.
WS A Rules > Merchants showing the Starbucks merchant ruleWS C More features page with Rules toggle off
✅
Offline: WS A ⋮ > Copy settings > WS C > Next > Merchant rules > Next shows the confirm page with Copy settings enabledWith Force offline on ("You appear to be offline" banner), the confirm page shows Settings: Merchant rules, Workspaces: WS C, and an enabled "Copy settings" button.
Copy settings confirm page while offline
✅
Tapping Copy settings offline shows the Concierge step, not an endless spinnerThe modal immediately shows "Concierge will let you know" / "When the process is completed, Concierge will send you a message." with "Go to Concierge" and "Dismiss". No "Copy in progress..." spinner appeared.
Concierge will let you know modal shown immediately offline
✅
Tapping Dismiss closes the modal and the app isn't stuckThe modal closed back to the Workspaces list, which stayed fully interactive.
Workspaces list visible after Dismiss
✅
Back online, WS C has Rules enabled with the merchant rule from WS AAfter turning off Force offline, WS C shows a Rules item, and Rules > Merchants shows the same Starbucks -> Advertising rule as WS A.
WS C Rules > Merchants showing the copied Starbucks rule
✅
Concierge / #admins confirm the copyConcierge posted "Your workspace settings have been copied from WS A to WS C." and #admins posted "copied 1 merchant rule from WS A".
Concierge chat message confirming settings copied
✅
Online regression: copy shows Copy in progress, then All Set (not the Concierge step)Online, the modal showed "Copy in progress..." with "Let me know when it's done", then changed to "All Set! Your workspace settings have been copied." with "Done" a few seconds later.
Online copy showing Copy in progress stepOnline copy resolved to All Set state
✅

view run · view recording

// Step 4: drive currentStep on the COPY_POLICY_SETTINGS key itself.
// Success intentionally omits this key — the backend transitions the bulk policy
// copy NVP state to complete, which the UI uses to show the completion modal.
// Offline, the copy is only queued, so skip the spinner and go straight to the Concierge notification step.

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.

"Queued" doesn't explain why we skip the spinner. What matters is that the request is not processed while offline.

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.

@MelvinBot please address the above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 29391e1. The comment now gives the real reason:

// Offline, the server can't process the copy until we reconnect, so the spinner would never finish.
// Skip it and go straight to the Concierge notification step.

src/libs/actions/Policy/CopyPolicySettings.ts:554-555


view run

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.

@MelvinBot, the comment is still inaccurate. Don't blame the server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in ddb4dd6. The comment now says the request isn't processed while offline:

// Offline, the copy request isn't processed until we reconnect, so the spinner would keep loading.
// Skip it and go straight to the Concierge notification step.

src/libs/actions/Policy/CopyPolicySettings.ts:554-555

I made the same fix to the matching test comment in tests/actions/CopyPolicySettingsTest.ts:728.


view run

@MelvinBot

MelvinBot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

Copying settings while offline now goes straight to "Concierge will let you know" instead of an endless "Copy in progress..." spinner. Dismiss works, the copy finishes once you're back online, and the online flow still shows "Copy in progress..." first. The tester couldn't read the JS console on web, so step 8 is unverified.
admins thread showing the online copy completed

Step Status
WS A has Rules enabled with a merchant rule, and WS C exists with Rules offWS A (Control) has the merchant rule 'Merchant is "Acme Corp" → Rename merchant to "Acme Corp", update category...' under Rules > Merchants. WS C (Control) has no Rules item in its left nav, so Rules is off.
WS A Rules > Merchants showing the Acme Corp merchant ruleWS C overview with no Rules item
✅
Offline: WS A ⋮ > Copy settings > WS C > Next > Merchant rules > Next shows the confirm page with Copy settings enabledWith Force offline on ("You appear to be offline" banner), the confirm page shows Settings: Merchant rules, Workspaces: WS C, and an enabled "Copy settings" button.
Copy settings confirm page while offline
✅
Clicking Copy settings offline shows the Concierge step, not an endless spinnerThe modal immediately shows "Concierge will let you know" / "When the process is completed, Concierge will send you a message." with "Go to Concierge" and "Dismiss". No "Copy in progress..." spinner appeared.
Concierge will let you know modal shown immediately offline
✅
Clicking Dismiss closes the modal and the app isn't stuckThe modal closed and the Workspaces list was fully interactive.
Workspaces list after dismissing the Concierge modal
✅
Back online, WS C has Rules enabled with the merchant rule from WS AAfter turning off Force offline, WS C shows Rules in its left nav, and Rules > Merchants shows the same Acme Corp rule as WS A.
WS C Rules > Merchants showing the copied Acme Corp rule
✅
Concierge / #admins confirm the copyConcierge posted "Your workspace settings have been copied from WS A to WS C." and #admins in WS C posted "copied 1 merchant rule from WS A".
Concierge message confirming settings copied from WS A to WS C
✅
Online regression: copy shows Copy in progress, then completes (not the Concierge step)Online, the modal showed the "Copy in progress..." spinner with "Let me know when it's done", not the Concierge step. The #admins thread got a second "copied 1 merchant rule" reply at 12:04 AM, confirming the online copy completed.
Copy in progress spinner shown while onlineadmins thread showing the online copy completed
✅
No errors related to this flow appear in the JS consoleNot verified: the web test tool can't capture the browser console. No error banners, red dots, or broken UI appeared during the offline or online flow.
⚠️

view run · view recording

Co-authored-by: Qichen Zhu <QichenZhu@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing typecheck check is unrelated to this PR. main is currently broken, so I didn't push a change.

Analysis: Thread report drafts explicitly through the split-transaction update flow merged into main at 23:41 UTC on October 12. It made reportDrafts a required field of UpdateSplitTransactionsParams. Three test calls in SplitTest.ts still omit that field, so main fails typecheck. This PR's check ran on a merge with that main commit.

Evidence:

  • All 3 errors are TS2741: Property 'reportDrafts' is missing in tests/actions/IOUTest/SplitTest.ts:3323, :3420, and :3529.
  • This PR changes only CopyPolicySettings.ts, CopyPolicySettingsConfirmPage.tsx, and CopyPolicySettingsTest.ts. None of them have type errors.

Next step: Once someone fixes SplitTest.ts on main, merge main into this branch or re-run the check.

The other failing checks (checklist and Check independent approval) are review checklists, not code failures.


view run

Co-authored-by: Qichen Zhu <QichenZhu@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Nothing has changed since my last check, so I still didn't push a fix. The typecheck failure comes from main, not this PR.

Next step: Ask daledah or the reviewers of that PR to fix SplitTest.ts on main. Then merge main into this branch or re-run the check.

The other two failures, checklist and Check independent approval, are review checklists, not code failures.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I still didn't push a fix. The typecheck failure comes from main, not this PR.

The latest run on ddb4dd6 shows the same 3 errors as my first check. Each is TS2741: Property 'reportDrafts' is missing in tests/actions/IOUTest/SplitTest.ts:3323, :3420, and :3529. This PR doesn't touch that file.

Thread report drafts explicitly through the split-transaction update flow introduced the break. It is still the latest commit on main, and I found no open PR that fixes it.

Next step: Ask daledah or the reviewers of that PR to add reportDrafts to those three test calls on main. Then re-run this check. If you want the fix pushed to this branch instead, reply and say so.

checklist and Check independent approval are review checklists, not code failures.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I still didn't push a fix. Nothing has changed since my first comment.

The fix belongs in a separate PR to main, not in this one. You could ask daledah, the author of that PR, to add reportDrafts to the three test calls. After that fix merges, merge main into this branch or re-run typecheck. Re-requesting this check before then will give the same result.


view run

@QichenZhu

Copy link
Copy Markdown
Contributor

@MelvinBot please merge main and mark this PR as ready for review.

…flineConciergeStep

Co-authored-by: Qichen Zhu <QichenZhu@users.noreply.github.com>
@MelvinBot
MelvinBot marked this pull request as ready for review October 13, 2026 10:01
@MelvinBot
MelvinBot requested a review from a team as a code owner October 13, 2026 10:01
@melvin-bot
melvin-bot Bot requested review from QichenZhu and removed request for a team October 13, 2026 10:01
@melvin-bot

melvin-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

@QichenZhu 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]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I merged main into this branch (no conflicts) and marked the PR as ready for review.

The PR's diff against main is still the same 3 files. CI will run the unit tests on the new merge commit.

The Tests and QA sections in the PR body still need your test steps before review.


view run

@melvin-bot
melvin-bot Bot removed the request for review from a team October 13, 2026 10:01
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T10:05:29.999506Z 94e898e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@joekaufmanexpensify joekaufmanexpensify 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.

good for product

@Julesssss
Julesssss merged commit 7889294 into main Oct 13, 2026
44 of 45 checks passed
@Julesssss
Julesssss deleted the claude-copySettingsOfflineConciergeStep branch October 13, 2026 18:43
@OSBotify

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

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Julesssss in version: 9.5.9-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed. This PR fixes an offline-only loading spinner when you copy workspace settings. The Copy Workspace Settings article doesn't describe the progress modal or offline behavior, and its statement that Concierge confirms when the copy completes is still accurate.


view run

@kavimuru

Copy link
Copy Markdown

@QichenZhu could you provide the QA steps?

@QichenZhu

Copy link
Copy Markdown
Contributor

@kavimuru sure.

  1. Create a Control workspace (Workspace A)
  2. Enable Rules in Workspace A
  3. Create at least one merchant rule in Workspace A
  4. Create a Control workspace (Workspace C)
  5. Disable Rules in Workspace C
  6. Go offline
  7. Click the ⋮ menu on Workspace A and select Copy settings
  8. Select Workspace C, click Next, tick Merchant rules, and click Next
  9. Click Copy settings
  10. Verify it shows the "Concierge will let you know" modal

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀

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

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants