[$175] [HR Import] Add "Manage connection" to the three-dot menu on healthy Merge connections
- Part of project Integrate with merge.dev to adopt widespread HR import
- Parent issue (internal)
Problem
An admin can re-authenticate a Merge connection only after it breaks (isAuthenticationError: true). There is no way to re-authenticate a healthy connection.
Admins need this when the employee whose credentials authorised the connection leaves. The admin must hand the connection over before that account is revoked. Today they must wait for the sync to break, or disconnect and connect again. Disconnecting deletes the Linked Account and loses the connection's settings.
Backend
Done (Integration-Server#9460): a relink to the same Linked Account keeps the connection's config (groups, filters, approval mode, final approver), clears isAuthenticationError, and does not re-run first-time setup. It covers merge_hris and merge_ats.
To do (internal, in the parent issue): start a sync after a relink. The card already shows the syncing state from lastSync.syncStatus, so the App needs no change for this.
Merge opens its update screen, not a new connection, because ConnectPolicyToMerge passes the policy ID as end_user_origin_id. The existing Reconnect action already calls this command on a connected policy. No new command is needed.
Behavior
- Add Manage connection to the three-dot menu on a connected Merge provider page (HR and Recruiting), above Disconnect.
- Show it when
isMergeConnectionName(card.connectionName)is true andneedsReconnectis false. In the error state the menu already shows Reconnect, which calls the same handler. - Do not show it for Gusto or Zenefits. They render through the same component but use our own OAuth flows.
- On press, show a confirmation modal (not the danger variant):
- Title:
Manage {provider} connection - Prompt:
You'll sign in to {provider} again. Your settings stay the same. - Confirm:
Continue
- Title:
- On confirm, call the existing
handleConnect. It opensConnectToMergeFlowwith the card'ssetupLink. - Disable the item when offline, the same as Sync now.
- Do not change the Reconnect link or menu item in the error state.
Mockups
Decisions already made
- Label.
Manage connection, notRelink. Merge's update screen also shows field mapping, so the label stays accurate when field-mapping overrides ship. - Sync. A relink starts a sync. Merge Link opens in a new tab and the App cannot tell a finished relink from a cancelled one, so the backend starts it.
- Billing. A relink to the same
end_user_origin_iddoes not create a second Linked Account. No extra cost. - Provider picker.
getMergeSetupLink()passes theintegrationslug, so Merge Link goes straight to the admin's own provider login.
Files
src/pages/workspace/merge/useMergeProviderCardDetails.tsx: add the item tooverflowMenubetweengetPrimaryMenuItem()and Disconnect. UseuseConfirmModal, the same as Disconnect.src/CONST: addMERGE_MENU_MANAGE_CONNECTIONtoSENTRY_LABEL.WORKSPACE.CONNECTIONS, next toMERGE_MENU_RECONNECT.src/languages/en.tsand the other locale files: menu label, modal title, prompt and confirm text, with the provider name as a parameter.- No change:
src/pages/workspace/connections/ConnectionsMergePageBase.tsx.handleReconnectworks for a healthy connection as-is.
Test steps
- On a Control workspace, connect BambooHR or Workday through Merge. Pick groups, set approval mode to Manager and choose a final approver.
- Open Workspace > Connections > HR. Confirm the three-dot menu shows Sync now, Manage connection and Disconnect.
- Tap Manage connection. Confirm the modal shows, then tap Continue.
- Confirm Merge Link opens on the update screen for that provider, with no provider picker.
- Sign in again with the same provider account. Confirm the groups, approval mode and final approver are unchanged, with no Complete Setup prompt.
- Confirm the Merge dashboard shows one Linked Account for the workspace.
- Break the connection (change the provider password). When the Reconnect error shows, confirm the menu shows Reconnect and not Manage connection.
- Repeat steps 2–5 on a Recruiting (ATS) connection.
- On a Gusto connection, confirm Manage connection does not show.
- Go offline. Confirm Manage connection is disabled.
Related issues
- Expensify/Expensify#678822: parent spec (internal)
- Expensify/Integration-Server#9460: backend relink handling
- #90605: error-state Reconnect prompt, same
handleConnectentry point - #99511: made the Merge card shared with ATS
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022126015789739664092
- Upwork Job ID: 2126015789739664092
- Last Price Increase: 2026-11-26
Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)
Investigation Progress:
- [x] Step 1: Extract symptoms and identifiers from issue
- [x] Step 2: Form hypothesis
- [x] Step 3: Pre-fetch hints and scan related issues
- [x] Step 4: Gather evidence with two researchers
- [x] Step 5: Evaluate evidence
- [x] Step 6: Challenge alternatives
- [x] Step 7: Assess runtime evidence requirements
- [x] Step 8: Prepare structured analysis
Both investigations support a missing menu entry rather than a restriction in the existing connection handler. App-side changes can stay small; preserving the Linked Account and starting the subsequent sync remain backend-dependent acceptance checks, not verified outcomes.
Proposal
What is the root cause of that problem?
Healthy Merge connections have no reauthentication entry point. The shared card only calls handleConnect from Reconnect when needsReconnect is true; otherwise it offers Complete setup or Sync now, followed by Disconnect.
The existing page handler already accepts healthy connections, so no new command or connection-flow change is needed.
What changes do you think we should make in order to solve the problem?
- Insert Manage connection immediately above Disconnect when
isMergeConnectionName(card.connectionName) && !card.needsReconnect. - Disable it offline and close the overflow menu before opening the confirmation.
- Use a non-danger confirmation with the specified provider-specific title and prompt. Reuse Continue and Cancel translations.
- Only on confirmation, call the existing
handleConnect. Never disconnect or replace the connection. - Add the menu’s Sentry label and localized strings. Leave error-state Reconnect, Gusto and Zenefits unchanged.
Code evidence and acceptance checks
- useMergeProviderCardDetails.tsx:98–167: current primary-action selection, overflow menu and existing confirmation pattern.
- MergeUtils.ts:15–21: the predicate includes Merge HR and ATS, excluding direct HR integrations.
- ConnectionsMergePageBase.tsx:67–84: the existing handler checks setup-link availability and write access, not authentication-error state.
- merge/index.ts:35–42: the setup URL already carries workspace, provider and category.
- ConnectionsMergeProviderCard.tsx:79–84: existing connected/write-access/not-syncing menu gates remain intact.
Test both HR and ATS: menu ordering, confirm versus cancel, offline disabling, authentication errors, incomplete setup, and Gusto/Zenefits exclusion. Use !needsReconnect, not a generic “no errors” condition.
Confidence: Medium. Static code supports the App change; browser and backend behavior were not verified. Settings retention, one Linked Account, provider-picker suppression and post-relink sync require end-to-end verification. The pending backend sync work remains a separate internal dependency.
What alternative solutions did you explore? (Optional)
Broadening Reconnect would change the established error-state behavior. Disconnecting first would violate the requirement to preserve the existing connection. Neither is necessary.
Related: Hide the Time Sensitive “Fix connection” card while that connection is syncing concerns adjacent sync-state behavior, not the same missing action.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/108123) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)
Job added to Upwork: https://www.upwork.com/jobs/~022126015789739664092
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a healthy Merge HR or Recruiting connection, the three-dot menu has no way to re-authenticate. An admin can only relink after the connection breaks, or by disconnecting, which deletes the Linked Account and its settings.
What is the root cause of that problem?
In src/pages/workspace/merge/useMergeProviderCardDetails.tsx, overflowMenu is built from getPrimaryMenuItem() plus Disconnect. getPrimaryMenuItem() only returns the handleConnect item (Reconnect) when card.needsReconnect is true; otherwise it returns Complete setup or Sync now. So handleConnect is never reachable for a healthy connection, even though handleReconnect in ConnectionsMergePageBase.tsx only checks card.setupLink and write access, not the error state.
What changes do you think we should make in order to solve the problem?
- In
useMergeProviderCardDetails.tsx, build the menu as[getPrimaryMenuItem(), ...manageConnectionItem, disconnectItem], where the Manage connection item is added only whenisMergeConnectionName(card.connectionName) && !card.needsReconnect(importisMergeConnectionNamefrom@libs/merge/MergeUtilsnext toshowMergeManualSyncLimitModalIfReached). This keeps Gusto/Zenefits and the error-state Reconnect unchanged. - The item uses
icons.Sync,disabled: isOffline,shouldCallAfterModalHide: true, and on select callsshowConfirmModal(same pattern as Disconnect, but withoutbuttonVariant: CONST.BUTTON_VARIANT.DANGER) with the new title/prompt,confirmText: translate('common.continue')andcancelText: translate('common.cancel'). Onresult?.action === ModalActions.CONFIRM, call the existinghandleConnect. - Add
MERGE_MENU_MANAGE_CONNECTIONtosrc/CONST/SENTRY_LABEL.tsnext toMERGE_MENU_RECONNECT. - Add
workspace.merge.manageConnection,manageConnectionTitle(providerName)andmanageConnectionPrompt(providerName)tosrc/languages/en.ts(besidedisconnectTitle/disconnectPrompt) and the other locale files.
No change to ConnectionsMergePageBase.tsx or the Merge actions, as the issue says.
What specific scenarios should we cover in automated tests?
A hook/component test for the Merge provider card: a connected healthy Merge HR and ATS card shows Sync now, Manage connection, Disconnect in that order; a needsReconnect card shows Reconnect and not Manage connection; a Gusto/Zenefits card doesn't show it; the item is disabled offline; confirming calls handleConnect once and cancelling doesn't call it.
What alternative solutions did you explore? (Optional)
Reusing the Reconnect label for healthy connections, but the issue already decided on Manage connection, and keeping it a separate item keeps the error-state menu unchanged.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Admins cannot re-authenticate a healthy Merge HR or Recruiting connection from its three-dot menu. Today they have to wait for the connection to break (needsReconnect) or disconnect and reconnect, which deletes the Linked Account and its configuration.
What is the root cause of that problem?
In src/pages/workspace/merge/useMergeProviderCardDetails.tsx, overflowMenu only contains [getPrimaryMenuItem(), disconnectItem]. getPrimaryMenuItem() only wires handleConnect when card.needsReconnect is true (Reconnect), so healthy Merge connections have no menu entry to open ConnectToMergeFlow even though handleReconnect in ConnectionsMergePageBase.tsx already works for any connected card with a setupLink.
What changes do you think we should make in order to solve the problem?
src/pages/workspace/merge/useMergeProviderCardDetails.tsx:- Add
'Key'touseMemoizedLazyExpensifyIcons(['Sync', 'Trashcan', 'Building', 'CheckCircle', 'Key'])to match the key icon shown in the mockup (@assets/images/key.svginexpensify-icons.chunk.ts). - Import
isMergeConnectionNamefrom@libs/merge/MergeUtilsalongsideshowMergeManualSyncLimitModalIfReached. - Insert a Manage connection item in
overflowMenubetweengetPrimaryMenuItem()and Disconnect whenisMergeConnectionName(card.connectionName) && !card.needsReconnect:icon: icons.Keytext: translate('workspace.merge.manageConnection')sentryLabel: CONST.SENTRY_LABEL.WORKSPACE.CONNECTIONS.MERGE_MENU_MANAGE_CONNECTIONdisabled: isOfflineshouldCallAfterModalHide: trueonSelected: checkif (!canWriteMoreFeatures) { showReadOnlyModal(); return; }first (consistent withcompleteSetupRouteandstaleGroupsRoutein the same hook, so read-only admins aren't shown the confirm modal before being blocked inhandleReconnect), then callshowConfirmModalwithoutCONST.BUTTON_VARIANT.DANGERusingtitle: translate('workspace.merge.manageConnectionTitle', card.displayName),prompt: translate('workspace.merge.manageConnectionPrompt', card.displayName),confirmText: translate('common.continue'), andcancelText: translate('common.cancel'). Onresult?.action === ModalActions.CONFIRM, callhandleConnect().
- Add
src/CONST/SENTRY_LABEL.ts:- Add
MERGE_MENU_MANAGE_CONNECTION: 'WorkspaceConnections-MergeMenuManageConnection'underWORKSPACE.CONNECTIONS, next toMERGE_MENU_RECONNECT.
- Add
src/languages/en.ts(and the remaining 10 locale files):- Add
manageConnection: 'Manage connection',manageConnectionTitle: (providerName: string) => \Manage ${providerName} connection`, andmanageConnectionPrompt: (providerName: string) => `You'll sign in to ${providerName} again. Your settings stay the same.`underworkspace.merge`.
- Add
- Leave
src/pages/workspace/connections/ConnectionsMergePageBase.tsxunchanged as specified.
What specific scenarios should we cover in automated tests?
- Unit test
useMergeProviderCardDetails:- Healthy Merge HR and ATS cards render
[Sync now / Complete setup, Manage connection, Disconnect]in order withicons.Key. - Cards with
needsReconnect: truerender[Reconnect, Disconnect]without Manage connection. - Non-Merge cards (Gusto / Zenefits) do not render Manage connection.
- Manage connection is disabled when
isOfflineis true. - Selecting Manage connection when
canWriteMoreFeaturesis false triggersshowReadOnlyModal()without opening the confirm modal. - Confirming the modal calls
handleConnect(); cancelling does not.
- Healthy Merge HR and ATS cards render
What alternative solutions did you explore? (Optional)
Letting handleConnect() handle the canWriteMoreFeatures check after modal confirmation, but gating before showConfirmModal avoids a redundant confirmation prompt for read-only admins and matches the existing guards in useMergeProviderCardDetails.
📣 @oktayudha05! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01eb24d273a13ebc7e
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a connected, healthy Merge HR or Recruiting provider page, the three-dot menu has no option to re-authenticate the connection. Admins currently have to wait for an authentication error (needsReconnect) or disconnect and reconnect, which deletes the Linked Account and wipes saved workspace configuration.
What is the root cause of that problem?
In src/pages/workspace/merge/useMergeProviderCardDetails.tsx, overflowMenu only includes [getPrimaryMenuItem(), disconnectItem]. getPrimaryMenuItem() only wires handleConnect when card.needsReconnect is true (Reconnect); for healthy connections it returns Complete setup or Sync now, leaving no entry point to handleConnect even though handleReconnect in ConnectionsMergePageBase.tsx already works for healthy connected cards.
What changes do you think we should make in order to solve the problem?
src/pages/workspace/merge/useMergeProviderCardDetails.tsx- Load the
'Key'icon inuseMemoizedLazyExpensifyIcons(matching the key icon in the mockup) and importisMergeConnectionNamefrom@libs/merge/MergeUtils. - Insert a Manage connection item in
overflowMenubetweengetPrimaryMenuItem()and Disconnect only whenisMergeConnectionName(card.connectionName) && !card.needsReconnect. This excludes Gusto/Zenefits and leaves the error-state Reconnect item untouched. - Configure the item with:
icon: icons.Keytext: translate('workspace.merge.manageConnection')sentryLabel: CONST.SENTRY_LABEL.WORKSPACE.CONNECTIONS.MERGE_MENU_MANAGE_CONNECTIONdisabled: isOfflineshouldCallAfterModalHide: true(ensures the three-dot popover finishes closing before presenting the confirmation modal)
- In
onSelected:- Guard
!canWriteMoreFeaturesfirst and callshowReadOnlyModal()so read-only callers do not see a confirmation dialog before being blocked inhandleReconnect. - Open
showConfirmModalusing the default non-danger (SUCCESS) confirm button variant with:title: translate('workspace.merge.manageConnectionTitle', card.displayName)prompt: translate('workspace.merge.manageConnectionPrompt', card.displayName)confirmText: translate('common.continue')cancelText: translate('common.cancel')shouldDisableConfirmButtonWhenOffline: true(prevents confirming if the user goes offline while the modal is already open)
- When
result?.action === ModalActions.CONFIRM, callhandleConnect(). BecauseConfirmModalWrapperresolves the promise insideonModalHide, launchingConnectToMergeFlow's fullscreen modal on iOS/Android will not collide with the closing confirmation modal.
- Guard
- Load the
src/CONST/SENTRY_LABEL.ts- Add
MERGE_MENU_MANAGE_CONNECTION: 'WorkspaceConnections-MergeMenuManageConnection'underWORKSPACE.CONNECTIONS, next toMERGE_MENU_RECONNECT.
- Add
- Localization (
src/languages/en.tsand the remaining 10 locale files)- Add
manageConnection,manageConnectionTitle(providerName), andmanageConnectionPrompt(providerName)underworkspace.merge, matching the exact copy in the spec and reusingcommon.continue/common.cancel.
- Add
- No changes to
src/pages/workspace/connections/ConnectionsMergePageBase.tsxhandleReconnectalready handles healthy Merge connections and passescard.setupLinkintoConnectToMergeFlow.
What specific scenarios should we cover in automated tests?
Add unit tests for useMergeProviderCardDetails covering:
- Healthy Merge HR and Recruiting cards show
[Sync now (or Complete setup), Manage connection, Disconnect]in order withicons.Key. - Merge cards with
needsReconnect: trueshow Reconnect and omit Manage connection. - Direct HR providers (Gusto, Zenefits) omit Manage connection.
- Manage connection is disabled when offline, and its confirm modal disables Continue when offline.
- Read-only state (
!canWriteMoreFeatures) triggersshowReadOnlyModalwithout opening the confirmation modal. - Confirming calls
handleConnectonce; cancelling does not callhandleConnect.
What alternative solutions did you explore? (Optional)
- Relying solely on
ConnectionsMergeProviderCardhiding the three-dot menu when!canWriteMoreFeatures(or lettinghandleReconnectcheck write access after confirmation) would leave the hook itself inconsistent withcompleteSetupRoute/staleGroupsRouteand could show a pointless confirm dialog to read-only callers. - Omitting
shouldDisableConfirmButtonWhenOfflineon the confirm modal would let a user who loses connectivity while the dialog is open still triggerConnectToMergeFlowoffline.