Skip to content

[Payment due @shubham1206agra] Copy workspace settings: don't leak Spotnana identity on travel copy + capture terms consent#93320

Merged
yuwenmemon merged 15 commits into
Expensify:mainfrom
ishpaul777:ishpaul/copy-travel-spotnana-provisioning-clean
Jun 17, 2026
Merged

[Payment due @shubham1206agra] Copy workspace settings: don't leak Spotnana identity on travel copy + capture terms consent#93320
yuwenmemon merged 15 commits into
Expensify:mainfrom
ishpaul777:ishpaul/copy-travel-spotnana-provisioning-clean

Conversation

@ishpaul777

@ishpaul777 ishpaul777 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Part of the bulk workspace-settings copy feature. When the Travel part is copied, two things needed fixing on the client:

  1. Optimistic data was leaking Spotnana identity fields. The travel part mapped to ['isTravelEnabled', 'travelSettings'], so the optimistic Onyx update copied the source's entire travelSettings — including spotnanaCompanyID, associatedTravelDomainAccountID, and hasAcceptedTerms — onto each target. successData never corrected those fields, so a target would optimistically (and then persistently, until a full refetch) show the source's Spotnana entity and hasAcceptedTerms: true, hiding the "Get Started" travel-provisioning state. This now copies only the non-identity autoAddTripName preference via a dedicated buildTravelSettingsPatch, preserving the target's own identity fields. The backend re-provisions each target with its own Spotnana entity, so the identity fields must never be copied. Mirrors Auth's TRAVEL_SETTINGS_COPYABLE_FIELDS allow-list.

  2. Travel terms consent. Copying travel from a provisioned source causes the backend to re-provision each target, which accepts Expensify Travel terms on the admin's behalf. The confirm screen now shows the Expensify Travel terms link and a consent checkbox whenever the Travel part is selected and the source workspace is provisioned for travel, and the Copy button is disabled until the admin checks it. No new request parameter is needed — the backend already derives which targets require provisioning.

Fixed Issues

$
PROPOSAL:

For https://github.com/Expensify/Expensify/issues/642749

Tests

  1. As an admin of a source workspace that has Travel enabled and is provisioned for Spotnana (it has a travelSettings.spotnanaCompanyID/associatedTravelDomainAccountID), and at least one target workspace that is NOT provisioned for travel.
  2. Start the bulk copy-settings flow from the source workspace.
  3. Select one or more target workspaces, then on the features step select Travel (and optionally other features). Continue to the confirm screen.
  4. Verify the confirm screen shows the Expensify Travel terms & conditions text with a link, plus a checkbox, above the Copy button.
  5. Verify the Copy button is disabled until the terms checkbox is checked.
  6. Check the box and tap Copy. Verify Copy travel works after loading modal is finished

Offline tests

  1. Go offline.
  2. Run the copy flow with Travel selected from a provisioned source and confirm.
  3. Verify the target optimistically shows Travel enabled and the copied autoAddTripName preference, but does NOT show the source's Spotnana identity fields or hasAcceptedTerms.
  4. Go back online and verify the state reconciles with the server (target gets its own provisioning via the backend, no identity fields from the source).

QA Steps

Same as tests.

  • 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 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
Screen.Recording.2026-06-16.at.6.06.52.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-06-16.at.6.01.44.AM.mov
iOS: Native
Screen.Recording.2026-06-16.at.6.04.10.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-06-16.at.5.55.25.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-16.at.5.53.13.AM.mov

ishpaul777 and others added 2 commits June 11, 2026 23:36
The optimistic Onyx patch for the "travel" part copied the entire source
travelSettings onto each target, including the per-policy Spotnana identity
fields (spotnanaCompanyID, associatedTravelDomainAccountID) and
hasAcceptedTerms. successData never corrected them, so a target would show the
source's provisioning state - including hasAcceptedTerms=true - hiding the
"Get Started" flow until a full policy refetch.

Copy only the non-identity autoAddTripName preference via a dedicated
buildTravelSettingsPatch, preserving the target's own identity fields. The
backend re-provisions each target with its own Spotnana entity. Mirrors Auth's
TRAVEL_SETTINGS_COPYABLE_FIELDS allow-list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When the travel part is selected and the source workspace is provisioned for
Spotnana, the backend re-provisions each target with its own entity, which
accepts Expensify Travel terms on the admin's behalf. Show the terms link and a
consent checkbox on the confirm screen and disable Copy until it is checked, so
the admin explicitly consents before provisioning runs. The backend already
derives which targets need provisioning, so no extra request param is needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 11, 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/libs/actions/Policy/CopyPolicySettings.ts 77.27% <100.00%> (+1.24%) ⬆️
src/components/BookTravelButton.tsx 2.35% <0.00%> (ø)
...nents/Navigation/QuickCreationActionsBar/index.tsx 85.54% <0.00%> (ø)
...bar/FABPopoverContent/menuItems/TravelMenuItem.tsx 4.00% <0.00%> (ø)
src/libs/CopyPolicySettingsUtils.ts 89.74% <0.00%> (-1.57%) ⬇️
src/libs/PolicyUtils.ts 74.39% <0.00%> (-0.05%) ⬇️
...ySettings/CopyPolicySettingsSelectFeaturesPage.tsx 72.41% <77.77%> (+0.15%) ⬆️
...pyPolicySettings/CopyPolicySettingsConfirmPage.tsx 0.00% <0.00%> (ø)
... and 7 files with indirect coverage changes

Build travelSettings patches explicitly from the target and consolidate test helpers to stay within the eslint-seatbelt baseline.
@ishpaul777 ishpaul777 marked this pull request as ready for review June 13, 2026 15:21
@ishpaul777 ishpaul777 requested review from a team as code owners June 13, 2026 15:21
@melvin-bot melvin-bot Bot requested review from Valforte and joekaufmanexpensify and removed request for a team June 13, 2026 15:21
@melvin-bot

melvin-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

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

if (!update || !('value' in update)) {
return undefined;
}

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.

❌ CONSISTENCY-5 (docs)

This eslint-disable-next-line comment lacks a justification. The other two similar disables in this file include explanations (e.g., -- SET value is a full Policy snapshot, -- MERGE value is a partial Policy patch), but this one does not.

Add a justification comment after --, for example:

// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- value is a CopyPolicySettings lifecycle object
return update.value as CopyPolicySettingsStep;

Reviewed at: 2464f97 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

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.

@ishpaul777 can you address this comment?

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.

Ah totally missed it, Added the missing eslint-disable justification in 7fbe3d1.

@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: 2464f97e4d

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +142 to +143
if (sourceAutoAddTripName === undefined || !targetTravelSettings) {
return undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Copy travel preferences for unprovisioned targets

When Travel is copied to a target that has no existing travelSettings (the unprovisioned target case covered by the QA/offline flow), this guard skips the autoAddTripName patch entirely. If the source has autoAddTripName: false, the optimistic target only gets isTravelEnabled: true, and the travel settings UI treats a missing value as enabled (policy?.travelSettings?.autoAddTripName !== false), so the copied workspace shows the opposite preference until a server refresh. Please still write a travel settings patch containing the source autoAddTripName while omitting the per-policy identity fields.

Useful? React with 👍 / 👎.

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.

Good catch - fixed in 2a3e91e. buildTravelSettingsPatch now triggers whenever the source has autoAddTripName defined (dropped the !targetTravelSettings guard that skipped unprovisioned targets), and spreads the target's existing travelSettings while overlaying autoAddTripName - the same pattern as setWorkspaceTravelSettings. So an unprovisioned target with a source autoAddTripName: false now optimistically gets {autoAddTripName: false} and the UI shows the correct preference. No identity fields are fabricated (spotnanaCompanyID/associatedTravelDomainAccountID stay undefined), so the target is still not treated as provisioned. Added a test for the unprovisioned-target + autoAddTripName: false case.

Resolve conflicts in CopyPolicySettings by keeping both travel settings
patch logic and receipt partners patch logic from their respective branches.
@Valforte

Copy link
Copy Markdown
Contributor

@ishpaul777 can you address codex comments?

ishpaul777 and others added 2 commits June 16, 2026 02:14
buildTravelSettingsPatch skipped the patch entirely when the target had no
existing travelSettings (the common unprovisioned case). A source with
autoAddTripName=false then left the optimistic target without the field, and
the travel settings UI treats a missing value as enabled - so the copied
workspace showed the opposite preference until a server refresh.

Spread the target's existing travelSettings and overlay autoAddTripName (the
setWorkspaceTravelSettings pattern). An unprovisioned target gets only
{autoAddTripName}, with no fabricated Spotnana identity fields, so it is still
not treated as provisioned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…isioned"

The autoAddTripName patch for a not-yet-provisioned target produces a
travelSettings object without the Spotnana identity fields, which failed
typecheck because spotnanaCompanyID/associatedTravelDomainAccountID/
hasAcceptedTerms were required. They are genuinely absent until the backend
provisions the workspace (and every read already optional-chains them), so mark
them optional - this removes the type error with no cast and no ripple.

Also rephrase "unprovisioned" to "not yet provisioned" in comments and the test
name to satisfy the spell check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

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

Core design doc PR

…pes.

Centralize the Spotnana provisioning check in PolicyUtils and use typed test helpers plus a Policy filter predicate on the confirm page.
@Valforte

Copy link
Copy Markdown
Contributor

PR looks good, no issues found, I'm ready to review as soon as the bot comment is resolved and we have a proper author checklist

@ishpaul777

Copy link
Copy Markdown
Contributor Author

@Valforte bot comment is addressed and checklist is fixed!

@shubham1206agra

Copy link
Copy Markdown
Contributor

@Valforte Should I review this first?

@Valforte

Copy link
Copy Markdown
Contributor

@shubham1206agra please! I'll remove the checklist

Copying travel from a provisioned source re-provisions each target, which
requires the admin to accept Expensify Travel terms (needs their legal name)
and a company address per target for the Spotnana entity - the same
prerequisites BookTravelButton enforces in the normal travel flow.

- Hide the Travel feature when the source is provisioned and the current user
  has no legal name, mirroring areTravelPersonalDetailsMissing.
- On the confirm screen, disable Copy and show a message when travel is being
  copied and any selected target has no company address.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@melvin-bot

melvin-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

…dress

Replace the confirm-screen red error + disabled Copy button with the existing
gray-out pattern used for accounting mismatches: disable the Travel feature row
and show an explanatory subtitle on the selection step.

Travel provisioning creates a Spotnana entity per target, which needs a company
address. The source address only reaches a target when "overview" is also
copied, so Travel is disabled when any target lacks an address - unless overview
is selected and the source has an address to supply. When the source has no
address either, Travel is hard-disabled since overview can't help.

Moves the message from confirmSettings.travelAddressRequired to
selectSettings.travelAddressMismatch across all locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ishpaul777 ishpaul777 requested a review from yuwenmemon June 16, 2026 17:34
Provisioning a target for travel does not require a legal name: AcceptSpotnanaTerms
has no legal-name check, and ProvisionUserSpotnana uses firstName/lastName with an
email fallback. A legal name is only required at trip-booking time, which
BookTravelButton already enforces. Gating the copy on it blocked a valid setup
flow, so remove the currentUserHasLegalName hiding of the Travel feature.

Also removes the "unprovisioned" wording that the spell check flagged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shubham1206agra

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 there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 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
  • xIf 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Screen.Recording.2026-06-16.at.10.12.21.PM.mov
Screenshot 2026-06-16 at 11 12 13 PM

@melvin-bot melvin-bot Bot changed the title Copy workspace settings: don't leak Spotnana identity on travel copy + capture terms consent [Payment due @shubham1206agra] Copy workspace settings: don't leak Spotnana identity on travel copy + capture terms consent Jun 16, 2026
@melvin-bot

melvin-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🎯 @shubham1206agra, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - no internal issue.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

Comment on lines +135 to +139
// Travel needs a company address on every target. When the source has no address either,
// copying "overview" can't supply one, so travel can never be provisioned - hard-disable it.
if (part === 'travel') {
return hasTargetWithoutAddress && !sourceHasAddress;
}

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.

cc @yuwenmemon for vizzz Spotnana required company address to provision so if any WS dont have and user dont copy it from overview it silently skip provisioning, so i diabled the travel part with grayed out pattern for this edge case

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.

Screenshot 2026-06-16 at 11 15 51 PM

Valforte
Valforte previously approved these changes Jun 17, 2026

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

LGTM

@Valforte

Copy link
Copy Markdown
Contributor

@ishpaul777 there are conflicts, can you fix it so we can merge?

yuwenmemon
yuwenmemon previously approved these changes Jun 17, 2026
@yuwenmemon

Copy link
Copy Markdown
Contributor

@ishpaul777 still conflicts.

Resolve import conflict in CopyPolicySettingsConfirmPage.tsx by keeping isSourceProvisionedForTravel and Policy type alongside upstream's isLoadingOnyxValue addition.
@ishpaul777 ishpaul777 dismissed stale reviews from yuwenmemon and Valforte via b60d554 June 17, 2026 19:22
@ishpaul777

Copy link
Copy Markdown
Contributor Author

fixed! @yuwenmemon

@yuwenmemon yuwenmemon merged commit 3b90c4c into Expensify:main Jun 17, 2026
34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.4.15-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help-site review: no docs/articles changes required for this PR.

I reviewed the changes against the help site and applied docs/HELPSITE_NAMING_CONVENTIONS.md, docs/HELP_AUTHORING_GUIDELINES.md, and docs/TEMPLATE.md. I did not open a draft docs PR. Here's why.

What this PR changes (user-facing): within the Copy settings flow (three dots (⋮) on a workspace in WorkspacesCopy settings), when Travel is copied from a source already set up for Expensify Travel:

  • The confirm screen now shows the Expensify Travel terms & conditions text plus an I agree to the terms & conditions checkbox, and the Copy settings button stays disabled until it's checked.
  • Travel can only be copied if every selected workspace has a company address.
  • (Not user-visible) Spotnana identity fields are no longer copied — each target is re-provisioned with its own travel entity.

Why no docs change is needed:

  1. The Copy settings feature is beta-gated and undocumented. The flow is only shown behind the BULK_EDIT_WORKSPACES beta, and there is no help-site article for it. Authoring a public article for a beta-only feature is premature, and this PR is a refinement within that unreleased flow rather than a new GA capability.
  2. The one related published article is a different flow. Duplicate-Workspace.md documents duplicating a workspace (creating a new workspace, ending with Continue). This PR only touched the copyPolicySettings pages/utils — it did not modify the duplicate flow — so adding a "Travel terms checkbox" note there would describe behavior that flow doesn't have.

Recommendation: When BULK_EDIT_WORKSPACES graduates from beta, a dedicated Copy settings article should be created, and it should cover this PR's Travel specifics (the Expensify Travel terms consent and the company-address requirement). I'm happy to draft that article at that point — just re-tag me.


@ishpaul777, does that match your expectation? If you'd like me to draft a beta Copy settings article (or add a Travel note to the Duplicate Workspace article) anyway, reply with @MelvinBot and I'll open a draft help-site PR.

@IuliiaHerets

Copy link
Copy Markdown

Hi @ishpaul777, can you please share clear QA steps for testing?
Can the QA team verify this, or does it depend on internal configurations that aren't available to us?

@yuwenmemon @Valforte @joekaufmanexpensify

@ishpaul777

Copy link
Copy Markdown
Contributor Author

Precondition:

  • User has a Workspace with Expensify Travel Setup, and one Workspace without Expensify Travel Setup.
  • User has bulk policy copy-settings beta enabled
  1. Start the bulk copy-settings flow from the source workspace.
  2. Select one or more target workspaces, then on the features step select Travel (and optionally other features). Continue to the confirm screen.
  3. Verify the confirm screen shows the Expensify Travel terms & conditions text with a link, plus a checkbox, above the Copy button.
  4. Verify the Copy button is disabled until the terms checkbox is checked.
  5. Check the box and tap Copy. Verify Copy travel works after loading modal is finished

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.15-3 🚀

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

@melvin-bot

melvin-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #94063

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.

8 participants